bt-xtgxq-system-bigdata-exa.../src/main.js

38 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-05-04 18:16:22 +08:00
import { createApp } from 'vue'
2023-05-06 18:09:41 +08:00
import { createRouter, createWebHashHistory } from 'vue-router'
2023-05-04 18:16:22 +08:00
import './style.css'
import App from './App.vue'
2023-05-09 22:02:21 +08:00
import axios from 'axios';
2023-05-04 18:16:22 +08:00
2023-05-06 18:09:41 +08:00
import Wgy from './components/table/Wgy.vue';
import Ddy from './components/table/Ddy.vue';
import ZfGa from './components/table/ZfGa.vue';
import Wgz from './components/table/Wgz.vue';
2023-05-06 18:09:41 +08:00
import Znbm from './components/table/Znbm.vue';
2023-05-09 22:02:21 +08:00
// 路由
2023-05-06 18:09:41 +08:00
const router = createRouter({
history: createWebHashHistory(),
routes: [
{ name: 'wgy', path: '/', component: Wgy },
{ name: 'ddy', path: '/ddy', component: Ddy },
{ name: 'zfga', path: '/zfga', component: ZfGa },
{ name: 'wgz', path: '/wgz', component: Wgz },
2023-05-06 18:09:41 +08:00
{ name: 'znbm', path: '/znbm', component: Znbm },
]
});
2023-05-09 22:02:21 +08:00
// axios
const createAxios = {
install(app, options) {
axios.defaults.baseURL = 'http://127.0.0.1:8087/bigdata';
2023-05-12 18:17:38 +08:00
axios.defaults.timeout = 20000;
2023-05-09 22:02:21 +08:00
app.config.globalProperties.$axios = axios;
}
}
2023-05-06 18:09:41 +08:00
const app = createApp(App);
app.use(router);
2023-05-09 22:02:21 +08:00
app.use(createAxios);
2023-05-06 18:09:41 +08:00
app.mount('#app');