stepin-template
stepin-template copied to clipboard
我使用yarn build编译时报错了。
src/router/index.ts:7:3 - error TS2345: Argument of type '{ history: { readonly base: string; readonly location: string; readonly state: HistoryState; push: (to: string, data?: HistoryState) => void; replace: (to: string, data?: HistoryState) => void; go: (delta: number, triggerListeners?: boolean) => void; listen: (callback: NavigationCallback) => () => void; createHref: ...' is not assignable to parameter of type 'RouterOptions'. Types of property 'routes' are incompatible. Type '({ component: FunctionalComponent<any, {}, any, {}> | ComponentPublicInstanceConstructor<any, any, any, any, ComputedOptions, MethodOptions> | DefineComponent<...> | Lazy<...> | { ...; }; ... 11 more ...; strict?: boolean; } | { ...; } | { ...; } | { ...; } | { ...; })[]' is not assignable to type 'readonly RouteRecordRaw[]'. Type '{ component: FunctionalComponent<any, {}, any, {}> | ComponentPublicInstanceConstructor<any, any, any, any, ComputedOptions, MethodOptions> | DefineComponent<...> | Lazy<...> | { ...; }; ... 11 more ...; strict?: boolean; } | { ...; } | { ...; } | { ...; } | { ...; }' is not assignable to type 'RouteRecordRaw'. Type '{ component?: FunctionalComponent<any, {}, any, {}> | ComponentPublicInstanceConstructor<any, any, any, any, ComputedOptions, MethodOptions> | DefineComponent<...> | Lazy<...> | { ...; }; ... 11 more ...; strict?: boolean; }' is not assignable to type 'RouteRecordRaw'. Type '{ component?: FunctionalComponent<any, {}, any, {}> | ComponentPublicInstanceConstructor<any, any, any, any, ComputedOptions, MethodOptions> | DefineComponent<...> | Lazy<...> | { ...; }; ... 11 more ...; strict?: boolean; }' is not assignable to type 'RouteRecordRedirect'. Types of property 'redirect' are incompatible. Type 'string | ((to: RouteLocation) => RouteLocationRaw) | { query?: LocationQueryRaw; hash?: string; path: string; replace?: boolean; force?: boolean; state?: HistoryState; } | { ...; }' is not assignable to type 'RouteRecordRedirectOption'. Type '{ query?: LocationQueryRaw; hash?: string; name?: RouteRecordName; path?: unknown; params?: RouteParamsRaw; replace?: boolean; force?: boolean; state?: HistoryState; }' is not assignable to type 'RouteRecordRedirectOption'. Type '{ query?: LocationQueryRaw; hash?: string; name?: RouteRecordName; path?: unknown; params?: RouteParamsRaw; replace?: boolean; force?: boolean; state?: HistoryState; }' is not assignable to type 'RouteLocationNamedRaw'. Types of property 'path' are incompatible. Type 'unknown' is not assignable to type 'undefined'.
7 reactive({ ~~~~~~~~~~ 8 history: createWebHashHistory(),
9 routes,
~~~~~~~~~~~
10 })
~~~~
Found 1 error in src/router/index.ts:7