http://vuejs.org.cn/guide/com...自定义事件
两个没有层级关系的组件不能用这个自定义事件直接进行通信?难道要通过他们的共同父元素才行?
我在一个事件中:
this.$on("setMultiColInput", (arg) => {
console.log("Asdasds")
})
在另外一个组件中,点击时:
this.$emit("setMultiColInput", this.selectedGroup)
当并不生效
http://vuejs.org.cn/guide/com...自定义事件
两个没有层级关系的组件不能用这个自定义事件直接进行通信?难道要通过他们的共同父元素才行?
我在一个事件中:
this.$on("setMultiColInput", (arg) => {
console.log("Asdasds")
})
在另外一个组件中,点击时:
this.$emit("setMultiColInput", this.selectedGroup)
当并不生效
9 回答1.7k 阅读✓ 已解决
6 回答946 阅读
3 回答1.3k 阅读✓ 已解决
4 回答950 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
3 回答858 阅读
3 回答1.3k 阅读✓ 已解决