$emit拋出數據上層組件接收時加入本身參數

parent.vuejavascript <Child v-for="(it, idx) of something" @someevent="arg => somemethod(arg, idx)"/> child.vuevue <button @click="$emit('someevent', arg)">Magic!</button>
相關文章
相關標籤/搜索