How do vue custom components respond to events in the parent component?

problem description

I customized a cont component, then referenced it in another component A, and placed some content in the cont component. How do I define events? For example, click, my way of writing is not supported, what should the correct way of writing look like? Is there a boss who loses a portal? thank you

the environmental background of the problems and what methods you have tried

related codes

/ / A component
< cont >
< div @ click= "click" > < / div >
< / cont >

methods: {
        click: () => {
            console.log("")
        }
    },

/ / cont components
< template >

<div class="content">
    <slot></slot>
</div>

< / template >

what result do you expect? What is the error message actually seen?

Jul.20,2021

https://cn.vuejs.org/v2/api/-sharp.

clipboard.png


officials say that methods cannot use the arrow function
and then if you want to trigger it in the component, either $emit, or this.$props.click ()

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b319f5-2bda7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b319f5-2bda7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?