From e1b02a29c1fa475d24557ae2952e68d1adb00348 Mon Sep 17 00:00:00 2001 From: wswmsword Date: Sun, 6 Aug 2023 21:57:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8=20mobile-forever=20=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E6=A1=8C=E9=9D=A2=E7=AB=AF=E5=8F=AF=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- postcss.config.js | 22 ++++++++-------------- src/App.vue | 5 +++++ src/views/cart/modules/Nav.vue | 7 ++++++- src/views/cart/modules/Tabbar.vue | 2 +- 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index b1d108d..0c1a178 100644 --- a/package.json +++ b/package.json @@ -46,8 +46,8 @@ "eslint-plugin-vue": "^6.2.2", "less": "^3.13.1", "less-loader": "^5.0.0", + "postcss-mobile-forever": "^0.0.1", "postcss-preset-env": "^6.7.0", - "postcss-px-to-viewport": "^1.1.1", "sass": "^1.32.10", "sass-loader": "^9.0.3", "svg-sprite-loader": "^4.2.1", diff --git a/postcss.config.js b/postcss.config.js index ed64934..4761f10 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -2,22 +2,16 @@ module.exports = { plugins: { // https://github.com/csstools/postcss-preset-env 'postcss-preset-env': {}, - // https://github.com/evrone/postcss-px-to-viewport/blob/master/README_CN.md - 'postcss-px-to-viewport': { - unitToConvert: 'px', - viewportWidth: 750, + // https://github.com/wswmsword/postcss-mobile-forever + 'postcss-mobile-forever': { + viewportWidth: file => /vant[\\/]/.test(file) ? 375 : 750, + maxDisplayWidth: 560, unitPrecision: 3, propList: ['*'], - viewportUnit: 'vw', - fontViewportUnit: 'vw', - selectorBlackList: ['.ignore', 'van'], - minPixelValue: 1, - mediaQuery: false, - replace: true, - exclude: [], - landscape: false, - landscapeUnit: 'vw', - landscapeWidth: 568 + selectorBlackList: ['.ignore'], + rootContainingBlockSelectorList: ['van-popup--bottom'], + disableLandscape: true, + disableDesktop: true } } } diff --git a/src/App.vue b/src/App.vue index 130fd32..86cc8d3 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,3 +23,8 @@ export default { } } + diff --git a/src/views/cart/modules/Nav.vue b/src/views/cart/modules/Nav.vue index d8dabf0..0ba72e8 100644 --- a/src/views/cart/modules/Nav.vue +++ b/src/views/cart/modules/Nav.vue @@ -3,7 +3,7 @@ -