1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import Vue from "vue";
- import App from "./App.vue";
- import store from "./store/index";
- // 路由
- import router from "./router";
- import axios from "@/utils/axios";
- import API from "@/api";
- // 共通filters
- import * as filters from "./filters";
- // 设置字体大小
- import "@/utils/rem";
- import "@/common/permission";
- import { Button, Image, Dialog, NavBar, Tabbar, TabbarItem, Tabs, Tab } from "vant";
- window.$_http = axios;
- // event Bus 用于无关系组件间的通信。
- Vue.prototype.$bus = new Vue();
- Vue.prototype.$_http = axios;
- Vue.prototype.$_API = API;
- Vue.component("VanButton", Button);
- Vue.component("VanImage", Image);
- Vue.component("VanDialog", Dialog);
- Vue.component("VanNavBar", NavBar);
- Vue.component("VanTabbar", Tabbar);
- Vue.component("VanTabbarItem", TabbarItem);
- Vue.component("VanTabs", Tabs);
- Vue.component("VanTab", Tab);
- Object.entries(filters).forEach(([key, value]) => {
- Vue.filter(key, value);
- });
- router.beforeEach(async (to, from, next) => {
- console.warn(to.name, to);
- try {
- } catch (error) {
- console.error(error);
- }
- next();
- });
- new Vue({
- router,
- store,
- render: h => h(App)
- }).$mount("#app");
|