1、安装插件
npm install --save ***
2、卸载插件
npm uninstall ***
3.清除缓存
npm clean cache
4.自动整理
npm run lint
5.打包
npm run build
eslint
1.跳过某段代码
/* eslint-disable /
111
/ eslint-enable */
2.跳过下行代码
// eslint-disable-next-line
严格模式
.eslintrc.js文件
rules: {
'semi':'off', // 关闭分好检查
'comma-dangle':'off' // 关闭都逗号检查
}
反向代理
module.exports = {
devServer: {
proxy: {
'/ajax': { // '*'指所有请求,携带ajax的请求拦截下来
target: '**********',// 代理到那此端口
changeOrigin: true
},
'/+++': { // /+++/引用
target: '*************',
changeOrigin: true
}
}
}
}
Vue路由中component || components
component可写为对象形式components
import Film from '@/views/home'
// 引入主页面,之后可以直接运用components中'../views/****'引入
// 引用通用组件
import Tabbar from '@/components/Tabbar.vue'
components: {
default: () => import(/* webpackChunkName: "about" */ '../views/****'),
foot: Tabbar // 引用底部导航不引用则不添加,APP.vue渲染router-view加name=“key”属性;例:<router-view name="foot"></router-view>
}