<com-input class='com-input-grey-bg' placeholder="you@email.com"
v-model="data.account as string" clearable></com-input>  
io.dcloud.uniapp.vue.UTSReactiveJSONObject cannot be cast to uni.UNIC2451D5.GenPagesLogin$Companion$setup$1$Info
报错地方:
v-model="data.account as string"
这怎么解决
申明对象
type InfoBase = {
account : string;
password : string;
}  
class Info extends UTSJSONObject {
account : string = "";
password : string = "";
constructor(obj : InfoBase) {
this.account = obj.account;
this.password = obj.password;
// return {
//  account:this.account,
//  password:this.password
// }
}
}  
const data = ref<Info>(new Info({  
    account: "", //123@qq.com  
    password: "" //12345678  
} as InfoBase));   
             
             
             
			 
                                        
                                     
            
0 个回复