RuoYi 框架中使用 lib-flexible 和 postcss-pxtorem 实现适配 - 排除 treeselect
在 RuoYi 框架中使用 lib-flexible 和 postcss-pxtoremloaderOptions: { css: {}, postcss: { plugins: [ autoprefixer(), pxtorem({ rootValue: 37.5, // 手机设计稿宽度为 375px 的 propList: [''], // 属性的选择器, 表示通用 exclude: /web/i, // 忽略 web 下的所有文件 selectorBlackList: ['.a-'] // 过滤掉 .a- 开头的 class,不进行 rem 转换 }), ] } } 实现适配时,可以将 treeselect 文件路径添加到 exclude 中,避免其样式被转换。
例如,可以将 exclude 修改为:
exclude: /web|treeselect/i, // 忽略 web 和 treeselect 下的所有文件
这样就可以避免 treeselect 的样式被 pxtorem 转换,保证其正常显示。
原文地址: https://www.cveoy.top/t/topic/oON1 著作权归作者所有。请勿转载和采集!