一、创建项目
vue create project-name
二、安装常用插件
1. vue-router 路由管理
npm install vue-router
涉及3个地方需要更改:
① main.js
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router/index";
// 拦截器
// import '@/router/permission'
const app = createApp(App);
app.use(router).mount("#app");
② app.vue
<template>
<div id="app">
<router-view />
</div>
</template>
<script>
export default {
name: 'App'
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
③ rou