booleen
booleen
  • 发布:2025-03-15 23:18
  • 更新:2025-03-15 23:18
  • 阅读:34

const xx=ref<State>({yy:x}) xx.value 类型不等于State吗?

分类:uni-app x
const xx=ref<State>({yy:x})  xx.value 类型不等于State吗?  

type State ={  
yy:string;  
}  
type ResultObj={  
   state:State;  
}  
const xx=ref<State>({yy:'xx'})    

function result():ResultObj{  

  return {  
    state:xx.value  

   } as ResultObj  

}  

**
异常:

error: java.lang.ClassCastException: io.dcloud.uniapp.vue.UTSReactiveJSONObject cannot be cast to uni.UNIC2451D5.State‌**

2025-03-15 23:18 负责人:无 分享
已邀请:

要回复问题请先登录注册