我想通過父組件中的this.$emit的方法來觸發子組件中的this.$on,應該要怎么做?我做過的嘗試:使用vue2.xstyle:#parent { width: 200px; height: 200px; background-color: #eee;
}
.child { width: 100px; height: 100px; background-color: red;
}html:<div id="parent" @click="test">
<p>{{ total }}</p>
<child v-on:increment="test"></child></div>javascript:
vue中的自定義事件只能子傳父?
智慧大石
2018-09-10 12:53:21