Vue3 + VIte + Ts:any类型“any”的参数不能赋给类型“never”的参数。

场景:使用 push 的时候报错

解决方法:

const menus = reactive([] as any[]);

或根据实际来断言

const menus = reactive([] as object[]);

推荐使用

const commodity = reactive<object[]>([]);

猜你喜欢

转载自blog.csdn.net/A88552211/article/details/125715255