You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I followed How to use Vue with Deno to created a project. It runs well, but got error in editor. It says Type 'boolean' is not assignable to type 'RawRouteComponent | null | undefined'.deno-ts(2322)
import{createRouter,createWebHistory,RouteRecordRaw}from"vue-router";importHomePagefrom"../components/HomePage.vue";importDinosaurfrom"../components/Dinosaur.vue";constroutes: Readonly<RouteRecordRaw[]>=[{path: "/",name: "Home",component: HomePage,// Type 'boolean' is not assignable to type 'RawRouteComponent | null | undefined'.deno-ts(2322)},{path: "/:dinosaur",name: "Dinosaur",component: Dinosaur,// Type 'boolean' is not assignable to type 'RawRouteComponent | null | undefined'.deno-ts(2322)props: true,},];constrouter=createRouter({history: createWebHistory("/"),
routes,});exportdefaultrouter;
Same error also appears in main.ts
import{createApp}from"vue";import"./style.css";importAppfrom"./App.vue";importrouterfrom"./router/index.ts";constapp=createApp(App);// Argument of type 'boolean' is not assignable to parameter of type 'Component<any, any, any, ComputedOptions, MethodOptions, {}, any>'.deno-ts(2345)app.use(router);app.mount("#app");
问题描述
Version: Deno 1.4.12
I followed How to use Vue with Deno to created a project. It runs well, but got error in editor. It says
Type 'boolean' is not assignable to type 'RawRouteComponent | null | undefined'.deno-ts(2322)
Here's some code:
src/components/Dinosaur.vue:
src/router/index.ts
Same error also appears in main.ts
App.vue
解决方案
在 .vscode/settings.json 中配置
deno.enablePaths
, 只允许 deno 插件在 deno 相关代码开启代码检测即可. 例如, 我的工程中只有 api 文件夹下的文件使用了 deno 相关的 apiThe text was updated successfully, but these errors were encountered: