How parent and child components in VUe pass $emit to trigger custom events

Child component: via $emit

this.$emit("listenToChildEvent", deliver)

When the parent component binds the event, call the method!

v-on:listenToChildEvent="showMsgFromChild"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325722445&siteId=291194637