阅读:42回复:0
vue3 emit 用法
import { ref, defineEmits } from 'vue'
// 1、定义的属性 const num = ref(0) // 2、定义发射给父组件的方法 const emits = defineEmits(['add1', 'decre1']) // 3、定义新增和递减计数方法 const increment = () => { num.value++ emits('add1', num.value) } ———————————————— 原文链接:https://blog.csdn.net/weixin_47228574/article/details/128144067 |
|