在組件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() }) }
import sys sys.path.append('../..') sys.path.append('.') sys.path.append('./') 把這些路徑都加入sys.path就找到了.