cnpm i postcss-px2rem -- save cnpm install px2rem -loader -- save 2 、配置px2rem build目录下vue - loader.conf.js中,做如下修改: module.exports = { loaders: utils.cssLoaders({ sourceMap: isProduction ? config.build.productionSourceMap : config.dev.cssSourceMap, extract: isProduction }), transformToRequire: { video: ' src ' , source: ' src ' , img: ' src ' , image: ' xlink:href ' }, postcss:[require( ' postcss-px2rem ' )({ ' remUnit ' : 37.5 , ' baseDpr ' : 2 })] /* 因为我是以750px(iphone6)宽度为基准,所以remUnit为37.5 */ } 3 、在static目录中,建js文件夹,放flex.js: (function(win, lib) { var doc = win.document; var docEl = doc