0

我有 3 个组件:

主要比较

  • 后期比较
  • 作者比较

我将数据传递post compmain comp

this.$emit('author', this.author);

main comp我将接收到的数据传递post compauthor comp

<router-view @author="author= $event"></router-view>
<router-view name="author" v-bind:author="author"></router-view>

它应该像魅力一样起作用,但只有一次。

当我单击按钮再次传递数据post compmain comp,它正在工作(通过警报检查)但main comp没有将新数据传递给author comp我正在使用watchauthor comp

watch: {
    author: function(){
        alert('OK);
    }
}
4

1 回答 1

0

我没有足够的声誉发表评论。你能把你的问题的代码笔放在一起吗?我试图在本地重新创建您的问题,但不能。道具更新了我完美传递的作者字符串。我怀疑您的应用程序中的其他东西会导致反应性问题。

于 2020-06-23T09:43:10.850 回答