//监听值的变化
@Watch("type")
setType(newVal: number,oldVal:number) {
console.log(newVal);
console.log(oldVal);
}
//对应modules里的chat
@State("Chat") chatList! : chatStatusInterface;
//对应总名称
@State("footNav") footNav!: footNavInterface;
//父往子传值
@Prop(Number) type! : number;
vue3.0 typescript 调用watch,state,prop等
未经允许不得转载:阿锋哥前端开发经验分享 » vue3.0 typescript 调用watch,state,prop等