我有 3 个组件:
主要比较
- 后期比较
- 作者比较
我将数据传递post comp给main comp
this.$emit('author', this.author);
在main comp我将接收到的数据传递post comp给author comp
<router-view @author="author= $event"></router-view>
<router-view name="author" v-bind:author="author"></router-view>
它应该像魅力一样起作用,但只有一次。
当我单击按钮再次传递数据post comp时main comp,它正在工作(通过警报检查)但main comp没有将新数据传递给author comp我正在使用watch的author comp
watch: {
author: function(){
alert('OK);
}
}