数据报表
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. const path = require('path');
  2. // const unit = require('./src/config/translatedUnit_server');
  3. module.exports = ({
  4. file
  5. }) => {
  6. const designWidth = file.dirname.includes(path.join('node_modules', 'vant')) ? 375 : 750;
  7. let isVant = file && file.dirname && file.dirname.indexOf("vant") > -1;
  8. let rootValue = isVant ? 375 : 750; // 判断条件 请自行调整
  9. return {
  10. plugins: {
  11. autoprefixer: {},
  12. "postcss-px-to-viewport": {
  13. unitToConvert: "px",
  14. viewportWidth: rootValue,
  15. propList: ["*"],
  16. unitPrecision: 2, // 转换后的精度,即小数点位数
  17. viewportUnit: "vw",
  18. fontViewportUnit: "vw",
  19. selectorBlackList: [],
  20. landscapeUnit: 'vh', // 横屏时使用的单位
  21. landscapeWidth: 667, // 横屏时使用的视口宽度
  22. selectorBlackList: [], // 指定不转换为视窗单位的类名
  23. minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
  24. mediaQuery: true,
  25. exclude: [],
  26. landscape: false,
  27. }
  28. }
  29. }
  30. }