# vue_shop **Repository Path**: lipengwei8521/vue_shop ## Basic Information - **Project Name**: vue_shop - **Description**: vue项目实战。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-06-09 - **Last Updated**: 2022-06-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # vue-shop ## Project setup ``` npm install ``` ### Compiles and hot-reloads for development ``` npm run serve ``` ### Compiles and minifies for production ``` npm run build ``` ### Lints and fixes files ``` npm run lint ``` ### Customize configuration See [Configuration Reference](https://cli.vuejs.org/config/). # 2021.06.08 15:53 创建分支 ```git checkout -b login``` 查看分支 git branch # 开发日志 ## 2021.06.21 ###去除语法警告 - 创建.prettierrc 文件 ```java { // 去除分号 "semi": false, // 用单引号 “singleQuote”: true } ``` ### 去除括号前空格的语法校验 - 在eslintrc.js 里面的rules中添加 ```java 'space-before-function-paren': 0 ``` ### 优化Element-ui的组件导入方式 - 在 src -> plugins -> element.js 把 ```javascript import { Button } from 'element-ui' import {Form, FormItem} from 'element-ui' import {Input} from 'element-ui' import {Message} from 'element-ui' ``` 合并为 ```javascript import { Button, Form, FormItem, Input, Message } from 'element-ui' ``` ### axios 请求拦截器 ```javascript axios.interceptors.request.use(config => { config.headers.Authorization = window.sessionStorage.getItem('token'); // 在最后必须 return config return config; }); ``` ### 为复制对象 引入依赖 lodash 其实 下面方法也可以把old拷贝到new中。 ```javascript let oldPerson = {name: 'zhangsan'} let newPerson = {} Object.assign(newPerson, oldPerson); ``` ### 引入 Echarts ```javascript let echarts = require("echarts"); ```