在組件1中調用組件2中的方法
組件1:
this.$bus.$emit("change_event", "參數")
mounted () { this.$bus.$on('change_event', (參數) => { // 需要調用的方法 this.init() }) }
在組件1中調用組件2中的方法
組件1:
this.$bus.$emit("change_event", "參數")
mounted () { this.$bus.$on('change_event', (參數) => { // 需要調用的方法 this.init() }) }