一 页面头部加载进度条
nprogress 页面进度条
安装 npm install --save nprogress
在vue项目中使用
在main.js页面引入
// 引入
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
使用
// 展示进度条
NProgress.start()
// 隐藏进度条
NProgress.done()
二 vue-cli – build时自动清除console
安装 babel-plugin-transform-remove-console 移除 console.log()
npm install babel-plugin-transform-remove-console --save-dev
设置只在项目发布阶段使用 开发阶段不使用
打开 项目的 babel.config.js
文件
配置如下