1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- import Vue from "vue";
- import App from "./App.vue";
- import store from "./store/index";
- // 路由
- import router from "./router";
- import axios from "@/utils/axios";
- import common from "@/utils/common";
- import API from "@/api";
- // 共通filters
- import * as filters from "./filters";
- // 设置字体大小
- import "@/utils/rem";
- import "@/common/permission";
- // 全局css
- import "@/styles/index.scss";
- import {
- Button,
- Image,
- Dialog,
- NavBar,
- Tabbar,
- TabbarItem,
- Tabs,
- Tab,
- Grid,
- GridItem,
- Icon,
- List,
- Cell,
- CellGroup,
- Swipe,
- SwipeItem,
- DropdownMenu,
- DropdownItem,
- Progress,
- Skeleton,
- Tag
- } from "vant";
- window.$_http = axios;
- // event Bus 用于无关系组件间的通信。
- Vue.prototype.$bus = new Vue();
- Vue.prototype.$_http = axios;
- Vue.prototype.$_API = API;
- Vue.use(common);
- 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);
- Vue.component("VanGrid", Grid);
- Vue.component("VanGridItem", GridItem);
- Vue.component("VanIcon", Icon);
- Vue.component("VanList", List);
- Vue.component("VanCell", Cell);
- Vue.component("VanSwipe", Swipe);
- Vue.component("VanSwipeItem", SwipeItem);
- Vue.component("VanDropdownMenu", DropdownMenu);
- Vue.component("VanDropdownItem", DropdownItem);
- Vue.component("VanProgress", Progress);
- Vue.component("VanCellGroup", CellGroup);
- Vue.component("VanSkeleton", Skeleton);
- Vue.component("VanTag", Tag);
- 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");
|