数据报表
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.

36 lines
1.1 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
  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')) ? 350 : 750;
  7. const designWidth = file.dirname.includes('node_modules/vant') ? 375 : 750;
  8. return {
  9. plugins: {
  10. autoprefixer: {},
  11. "postcss-px-to-viewport": {
  12. unitToConvert: "px",
  13. viewportWidth: designWidth,
  14. propList: ["*"],
  15. unitPrecision: 3, // 转换后的精度,即小数点位数
  16. viewportUnit: "vw",
  17. fontViewportUnit: "vw",
  18. selectorBlackList: [],
  19. landscapeUnit: 'vh', // 横屏时使用的单位
  20. landscapeWidth: 667, // 横屏时使用的视口宽度
  21. selectorBlackList: [], // 指定不转换为视窗单位的类名
  22. minPixelValue: 1, // 默认值1,小于或等于1px则不进行转换
  23. mediaQuery: true,
  24. exclude: [],
  25. landscape: false,
  26. rules: {
  27. path: 'vant',
  28. fn(pixels, translated) {
  29. return `${translated * 2}${unit.vw}`;
  30. },
  31. },
  32. }
  33. }
  34. }
  35. }