Vue使用this.$refs.子组件ref. 方法 报错:Cannot read property ‘resetFields‘ of undefined 问题
子组件定义单独方法
        resetForm(formName) {
            this.$nextTick(()=>{
                this.$refs[formName].resetFields();
            })                
        },
这是因为表单还没有编译渲染进dom里面。
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭