【发布时间】:2019-09-20 10:53:55
【问题描述】:
嗨,我正在开发 Vue.js 模板,但我卡在了需要使用循环语句显示动态 v-dialog 的地方,但现在它显示了所有内容。
Dom:
<template v-for="item of faq">
<div :key="item.category">
<h4>{{ item.heading }}</h4>
<div v-for="subitems of item.content" :key="subitems.qus">
<v-dialog
v-model="dialog"
width="500"
>
<template v-slot:activator="{on}">
<a href="#" v-on="on">{{subitems.qus}}</a>
</template>
<v-card>
<v-card-title
class="headline grey lighten-2"
primary-title
>
Privacy Policy
</v-card-title>
<v-card-text>
{{ subitems.ans }}
</v-card-text>
<v-divider></v-divider>
</v-card>
</v-dialog>
</div>
</div>
</template>
脚本:
export default {
data: () => ({
faq,
dialog:false,
}),
}
我不明白我怎么能做到这一点。如果我点击一个按钮,它就会显示全部。
【问题讨论】:
-
您想要的输出到底是什么?您将对话框的模型绑定到同一个变量,并且不想一次全部显示?
标签: javascript vue.js vuejs2 vuetify.js