# Microblog3 **Repository Path**: CLA_QCM/microblog3 ## Basic Information - **Project Name**: Microblog3 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-12 - **Last Updated**: 2021-07-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ##根据package.json安装依赖 ``` npm install ``` ## 安装element-ui ``` npm install element-ui ``` ## 在main.js中 ``` import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; Vue.use(ElementUI); ``` ## 安装sass ``` npm install node-sass@4.14.1 sass-loader@10.0.2 ``` ## 安装vue路由 ``` npm install vue-router ``` ## 在main.js中 ``` import VueRouter from "vue-router"; Vue.use(VueRouter); ``` ## 编写router.js,并在main.js中引入 ``` import router from '@/router/router' new Vue({ router, render: h => h(App), }).$mount('#app1') ``` ## router.js中 ``` import VueRouter from "vue-router"; export default new VueRouter({ routes: [ {path: '/', redirect: '/index'}, {path: '/index', component: () => import('@/page/index')}, {path: '/login', component: () => import('@/page/login')}, {path: '*', component: () => import('@/page/404')}, ] }) ``` ## 安装axios ``` npm install axios ``` ## 在main.js中 ``` axios.defaults.baseURL = 'http://xxx:8999'; axios.defaults.validateStatus = val => val >= 200 && val <= 500; Vue.prototype.$axios = axios; ```