Use @click. Native =”event()” code to display:
<template> <son-comp @click.native="clickComp"></son-comp> </template> <script> import sonComp from '.... 'export default {components:{sonComp}, methods:{clickComp() {console.log(" subcomponent is clicked ")}}} </scrip>Copy the code
Note: Use native modifiers only when binding events directly to custom components, as normal HTML tags (buttons, etc.) will invalidate the event!