vue3 子组件修改父组件的两种方法

<jdy-goods-attr 
      :goods_sn="goods.goods_sn"
      @goods_sn="(msg) => goods.goods_sn = msg"
      v-model:goods_num="goods.goods_num"
></jdy-goods-attr>
const emit = defineEmits(['goods_sn','update:goods_num']);
//方法一
emit('goods_sn',sn.value)
//方法二
emit('update:goods_num',num.value)

posted @ 2023-11-15 16:15  窦戈  阅读(731)  评论(0编辑  收藏  举报