我对 vue.js 很陌生,但我可以弄清楚一些事情。我从普通的 js 开始,但现在切换到带有类样式 vue 组件的 typescript。对于组件样式,我使用 bootstrap-vue。
在我的 main.ts 文件中,我导入了 bootstrap 以及 vuex 商店
...
import BootstrapVue from 'bootstrap-vue'
//use custom bootstrap styling
import '../src/bootstrap/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
Vue.use(BootstrapVue)
...//some more code
new Vue({
router,
store,
i18n,
render: h => h(App)
}).$mount('#app')
Run Code Online (Sandbox Code Playgroud)
在商店中我动态注册了一个 NotificationModule
通知模块.ts
//import node modules
import { Module, VuexModule, Mutation, Action } from "vuex-module-decorators";
import { store } from "@/store";
//import application modules
import i18n from '@/i18n';
import Notification from '../types/Notification';
import Message from '../types/Message';
import …Run Code Online (Sandbox Code Playgroud)