vue3 element-ui 关闭 el-dialog 弹窗时报错

父组件

<template>
    <!-- 商品分类弹窗 -->
    <CategoryDialog v-model:categoryVisible="categoryVisible" :cateList="cateList" :categoryIds="form.categoryIds" @onSave="onSaveCategory" />
</template>

子组件

export default defineComponent({
  name: 'category-dialog',
  props: {
    categoryVisible: {
      type: Boolean
    }
  },
  data() {
    return {
        ...
    } as pageState
  },
  watch: {
    categoryVisible(newVal) {
      if (newVal) {
        this.selectedCategory = []
        this.initCategory()
      }
    }
  },
  methods: {
    onCancel() {
      this.$emit('update:CategoryVisible', false)
    },
})

报错信息

阅读 2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题