1. 使用postcss-px2rem或者postcss-plugin-px2rem讲vue项目的px全部转换未rem适配。
2. 下载:
npm install --save postcss-px2rem
npm install --save postcss-plugin-px2rem
3. 使用:在vue.config.js中
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? '/online/' : '/',
// outputDir: 在npm run build时 生成文件的目录 type:string, default:'dist'
// outputDir: 'dist',
// pages:{ type:Object,Default:undfind }
runtimeCompiler: true,
devServer: {
port: 8888, // 端口号
host: 'localhost',
https: false, // https:{type:Boolean}
open: false, //配置自动启动浏览器
//proxy: 'http://172.20.10.9:8080', // 配置跨域处理,只有一个代理
proxy: {
'/auidt': {
target: 'http://172.20.10.9:8080',
ws: true,
changeOr