一,vue3中defineEmits
1.defineEmits
用于在setup
中注冊自定義事件,是一個宏函數,使用時無需導入
2.defineEmits
接受一個數組,元素為自定義事件名文章來源:http://www.zghlxwxcb.cn/news/detail-709132.html
const emits = defineEmits(["onOK"])
3.defineEmit
返回一個觸發(fā)器,用于觸發(fā)事件,第一個參數是具體事件,第二個是傳遞的值文章來源地址http://www.zghlxwxcb.cn/news/detail-709132.html
const emits = defineEmits(["onOK"])
emits('onOK', 123)
到了這里,關于defineEmit的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!