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 Wgy3 from './components/table/Wgy3.vue';
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: 'wgy3', path: '/wgy3', component: Wgy3 },
{ 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';
axios.defaults.timeout = 6000;
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');