【发布时间】:2018-03-12 10:36:25
【问题描述】:
我使用标准的vuetifyjs/dialogs...所有脚本和模板都在同一页面中,没有服务器端。页面中的顺序是这样的:
<div id="main"> ...
<v-expansion-panel>...<!-- v-for... -->
<v-btn @click="$emit('go-modal', {title: 'Hello', body: 'Bye!'})">Go</v-btn>
...
</v-expansion-panel>
</div>
...
<div id="appDlg">...
<v-dialog v-model="dialog" fullscreen>...
<v-btn color="primary" dark slot="activator">TEST</v-btn>
...
</v-dialog>
</div>
(扩展面板和 TEST btn 正在工作!) 并在 /body 脚本之后作为
var mainVue = new Vue({el: '#main',...});
new Vue({
el: '#appDlg',
//data () { return {
data: {
dialog: false,
notifications: false,
sound: true,
widgets: false,
ct_header: 'the header1 here',
ct_body: 'the body1 here'
},
//}} // func data
mounted() {
mainVue.$on('go-modal', this.handleMain);
},
methods: {
handleMain(data) {
this.ct_header = data.title;
this.ct_body = data.body;
}
}
}) //vue instance
【问题讨论】:
-
你没有定义
lexLista。我想你想要mainVue.$on('go-modal', ...),对吧? -
嗨@thanksd,谢谢,我编辑了...但没有改变问题...
标签: vue.js vuetify.js