| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- // The Vue build version to load with the `import` command
- // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
- import Vue from 'vue'
- import App from './App'
- import router from './router'
- import store from './store'
- import http from '@/utils/http/init';
- import blRule from '@/utils/blRule';
- import vant, { Toast } from 'vant'
- import 'vant/lib/index.css';
- // Date 扩展插件
- import 'datejs'
- import './assets/css/base.scss';
- import './assets/css/ui.scss';
- // 自定义指令
- import '@/directive/blMobile'
- Vue.mixin({
- data() {
- let route = this.$route || {}
- return {
- vueRouteName: route.name
- }
- },
- watch: {
- $route(to, from) {
- if (to.name === this.vueRouteName) {
- this.vueWatchRoute && this.vueWatchRoute(to, from)
- }
- }
- },
- created () {
- if ('TITLE' in this) {
- this.$store.commit('SET_HEADER_TITLE', this.TITLE)
- }
- }
- })
- Vue.use(vant);
- Vue.use(http);
- Vue.use(blRule);
- Vue.config.productionTip = false
- // Toast 多个Toast
- Toast.allowMultiple()
- // 将所有 Toast 的展示时长设置为 2000 毫秒
- Toast.setDefaultOptions({ duration: 3000 });
- Toast.setDefaultOptions('loading', { forbidClick: true });
- /* eslint-disable no-new */
- new Vue({
- el: '#app',
- router,
- store,
- components: { App },
- template: '<App/>'
- })
|