1. Missing required prop: "index"
2. Invalid prop: type check failed for prop “router“. Expected Boolean, got String with value “true“.
我们是用ElementPlus,是导航的时候出现了警告
3. 'xxxxx' is a type and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled.ts
4. "getActivePinia()" was called but there waw no active pinia. Ara you trying to use a store before calling "app.use(pinia)"
5. RangeError: Maximum call stack size exceeded
router.beforeEach()死循环
//如下所示,else的时候做一个判断
router.beforeEach((to, from, next) => {
if (!isMobile()){ // PC端访问
console.log("PC端访问")
if (to.path !== '/login' && to.path !== '/register' && !isLogin()) {
return next('/login')
}
next()
}
else {
console.log("移动设备")
if (to.path == '/tip'){ //关键所在:如果要跳转的路径是/tip才放行
next()
}
else {
next('/tip')
}
}
})
6. inject() can only be used inside setup() or functional components
7. Type 'unknown' is not assignable to type 'string'
async function changeTalkLove() {
person.value.talkLove = await loveTalk() as string;
console.log('api result :', person.value.talkLove)
}