移动端适配

134 阅读1分钟

参考vant官方文档

因为vant的组件是按照375的设计图设计的,所以带vant的组件设计为37.5而我们开发的设计图大小为750所以要设置75.

postcss.config.js:

module.exports = {
    plugins: {
        'postcss-pxtorem': {
            rootValue({ file }) {
                return file.indexOf('vant') !== -1 ? 37.5 : 75;
            },
            propList: ['*'],
        },
    },
};

main.js:

import 'lib-flexible/flexible'