技术栈
vue3 + vite + ts
下载依赖
npm i lib-flexible postcss-pxtorem -S
main.ts中引入
// 直接引入包即可(亲测有用)
import 'lib-flexible';
// 或(暂时没有@types)
import 'lib-flexible/flexible.js';
创建postcss.config.ts配置配置配件
module.exports = {
plugins: {
"postcss-pxtorem": {
rootValue: 37.5,
propList: ["*"],
...
},
},
};