https://jsbin.com/?html,output
once I create a new nuxt.js project(typescript + Element-UI) and then run it, it's going wrong. Development and build are the same failure.
no failure found.
nuxt:typescript 09:49:56rojects/test/node_modules/@nuxt/types/app/index.d.ts(119,18):
119:18 Interface 'NuxtApp' incorrectly extends interface 'Vue'.
Types of property '$loading' are incompatible.
Type 'NuxtLoading' is not assignable to type '(options: LoadingServiceOptions) => ElLoadingComponent'.
Type 'DefaultNuxtLoading' is not assignable to type '(options: LoadingServiceOptions) => ElLoadingComponent'.
Type 'DefaultNuxtLoading' provides no match for the signature '(options: LoadingServiceOptions): ElLoadingComponent'.
export interface NuxtApp extends Vue {
^
$options: NuxtAppOptions
$loading: NuxtLoading
context: Context
Check here:
https://github.com/ElemeFE/element/issues/17329
tsconfig.json: add "skipLibCheck: true" into compilerOptions
/cc @kevinmarrec
Duplicate of #49
See https://github.com/nuxt/typescript/issues/49#issuecomment-562945877
There's unfortunately nothing we can do, you may find workaround in the related issue.
From my POV it's not directly TypeScript issue but overall 2 frameworks setting a different $loading property on Vue instances. And as both are providing typings for it, it's buggy.
Overall I think it's component library fault (element, buefy, ...) cause they are 3rd parties, Nuxt isn't. Vuetify for example doesn't have this problem cause they namespaced everything in $vuetify object.
It should have been $element.loading or something similar.
Most helpful comment
tsconfig.json: add "
skipLibCheck: true" into compilerOptions