miniprogram-to-uniapp icon indicating copy to clipboard operation
miniprogram-to-uniapp copied to clipboard

子组件内使用setData和emit函数报 TypeError: this.$forceUpdate is not a function 错误

Open calvinlsy86 opened this issue 7 months ago • 1 comments

问题描述?

组件内包含的子组件,在使用this.setData和this.$emit的时候,会报 TypeError: this.$forceUpdate is not a function 错误 image

重现步骤

在u-child-comp组件的methods 下创建函数,如

methods: { updateData(obj){ this.setData({obj}) },

 change(type){
      this.$emit('changeType', {
                    detail: {
                        type
                    }
      });
 }

}

期望的结果

在子组件也正常使用setData和this.$emit

calvinlsy86 avatar Jul 12 '24 02:07 calvinlsy86