天天看点

vue3+ts 不能将类型“string”分配给类型“Record<string, any>

vue3+ts 不能将类型“string”分配给类型“Record<string, any>

错误代码:

vue3+ts 不能将类型“string”分配给类型“Record<string, any>
const tableRow = ref("");
           

修改后:

const tableRow = ref("" as any);  //需要做类型断言处理
           

继续阅读