tsconfig.json
compilerOptions
{
"compilerOptions": {
"baseUrl": ".",
// other options go here
"typeRoots": [
"./node_modules/@types",
"./typings"
]
}
}
typings/vue
t配置.json
类型/Vue
index.d.ts
import Vue from 'vue';
import { AppStore } from '../../src/store/store';
declare module 'vue/types/vue' {
// Global properties can be declared
// on the `VueConstructor` interface
interface VueConstructor {
// some more augmentation
}
// Properties added to Vue interface are added to Vue instance
interface Vue {
store$: AppStore;
}
}
node_modules/@types/vue
node_modules/vue