store, has been introduced but I don"t know why I still prompt undefined, to solve it! Thank you
import Vue from "vue"
import iView from" iview"
import "iview/dist/styles/iview.css"
import Router from".. / router"
import store from". / store/quanxianStore"
import App from".. /.. / vue/admin/quanxian.vue"
Vue.use (iView)
new Vue ({
el: "-sharpapp",
router: Router,
store: store,
render: h => h(App)
})
/ * *
- Extends interfaces in Vue.js
* /
vue.d.ts
import Vue, {ComponentOptions} from "vue";
import {Store} from ". / index";
declare module "vue/types/options" {
interface ComponentOptions < V extends Vue > {
store?: Store<any>;
quanxianStore?: Store<any>;
}
}
declare module "vue/types/vue" {
interface Vue {
$store: Store<any>;
$quanxianStore: Store<any>;
}
}