| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- // 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 ViewScroll from '@/components/ViewScroll'
- 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'
- import '@/directive/blBr'
- 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.component('view-scroll', ViewScroll)
- 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/>'
- })
|