data() { return { //是否显示弹出框 dialogVisible: false, detail: [], zoom: 10, icon: [], srcList: [], id: '' } }, changeStatus(index, row) { this.$bus.$emit('edit', row); //点击弹出对话框 this.$bus.$emit('status', true) },
//接收传来的值 this.$bus.$on('status', data => { this.dialogVisible = data });
监听data里的 dialogVisible
watch: { dialogVisible: { handler(newVal) { if (newVal = true) { http.check(this.id).then(res => { if (res.applicationTime !== null) { res.applicationTime = parseTime(res.applicationTime); } else { res.applicationTime = '暂无' } this.icon = res.icon.split(',') this.srcList = res.icon.split(',') this.detail = res }); } }, deep: true } }