项目场景:
Vue+Ts
问题描述
提示:这里描述项目中遇到的问题:
在定义子组件的时候 报错 Property or method "medicalVisable" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
(属性或方法“medicalVisable”未在实例上定义,但在渲染期间被引用。 通过初始化该属性,确保该属性是反应性的,无论是在数据选项中,还是对于基于类的组件。
)
原因分析:
提示:这里填写问题的分析:因为Ts+Vue项目必须要渲染Component 和普通vue项目不一样,ts的项目是Component 不仅仅是有子组件加载时才需要,当前的组件也需要挂载, 否则的话组件渲染就会报错
解决方案:
提示:这里填写该问题的具体解决方案:
@Component({
components: {
}
})