-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accessing v-for loop vars from v-runtime-template #9
Comments
it doesnt work for me too |
I don't think that's possible, since the As a workaround you can create a component for the items on the list. In that way, the row would be in the component scope: <Row :row="row" v-for="row in rows"> |
Or even to place the for loop within the template: <template>
<div id="app">
<v-runtime-template :template="tmplt2" />
</div>
</template>
<script>
import VRuntimeTemplate from "v-runtime-template";
export default {
name: "App",
components: {
VRuntimeTemplate,
},
data() {
return {
rows: [1,2,3],
tmplt2: `
<div>
<p v-for="row in rows">{{ row }}</p>
</div>
`
}
}
} |
Any option is valid as long as the template access only component instance variables |
Is it possible to use the
v-for
variables inside thev-runtime-template
along the following lines:https://codesandbox.io/s/01l5j73k90
The text was updated successfully, but these errors were encountered: