场景:新增数据后刷新Table
方法:
子组件代码:
- 在子组件中使用emit引用父组件的方法
const emit = defineEmits({
'refrashTable': null
})
- 调用该方法
const refrashTable = () => {
emit("refrashTable")
}
很方便,先引用再直接调用
微信扫一扫
子组件代码:
const emit = defineEmits({
'refrashTable': null
})
const refrashTable = () => {
emit("refrashTable")
}
很方便,先引用再直接调用
相关推荐