vue3一些组件的使用方法
import vue3videoPlay from 'vue3-video-play'
import 'vue3-video-play/dist/style.css'
import Vant from 'vant';
import 'vant/lib/index.css';
import naive from 'naive-ui'
import * as echarts from 'echarts';
app.config.globalProperties.$echarts = echarts
import axios from 'axios'
import vueAxios from 'vue-axios'
import store from './store'
import router from './router'
use(vueAxios,axios).use(router).use(store)
import { createRouter, createWebHashHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes = [
{
path: '/home',
name: 'home',
component: HomeView
},
{
path: '/login',
name: 'login',
component: () => import( '../views/LoginView.vue')
}
]
const router = createRouter({
history: createWebHashHistory(),
routes
})
export default router
import { createStore } from 'vuex'
export default createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
modules: {
}
})
配置转发
const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true,
devServer: {
port: 8081,
host: '127.0.0.1',
proxy: {
'/api': {
target: `http://127.0.0.1:8080`,
changeOrigin: true,
ws: false,
pathRewrite: {
'^/api': ''
}
}
}
}
})