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

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