Skip to content

Commit 0267b6d

Browse files
committed
chore: use postcss-mobile-forever to keep usability of mobile viewport
1 parent 785e9f4 commit 0267b6d

File tree

4 files changed

+19
-12
lines changed

4 files changed

+19
-12
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"@vitejs/plugin-legacy": "^3.0.1",
4444
"@vitejs/plugin-vue": "^4.0.0",
4545
"@vitejs/plugin-vue-jsx": "^3.0.0",
46-
"@yuo/postcss-px2vw": "^1.0.5",
4746
"autoprefixer": "^10.4.13",
4847
"babel-plugin-module-resolver": "^4.1.0",
4948
"commitizen": "^4.2.6",
@@ -56,6 +55,7 @@
5655
"mockjs": "^1.1.0",
5756
"path-to-regexp": "^6.2.1",
5857
"plop": "^3.1.1",
58+
"postcss-mobile-forever": "^2.2.2",
5959
"rollup": "^3.7.2",
6060
"rollup-plugin-visualizer": "^5.8.3",
6161
"signale": "^1.4.0",

pnpm-lock.yaml

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/router/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import 'nprogress/nprogress.css'
77
import mian from '@/views/index.vue'
88
import mock from '@/views/mock/index.vue'
99
import charts from '@/views/charts/index.vue'
10-
NProgress.configure({ showSpinner: true })
10+
NProgress.configure({ showSpinner: true, parent: '#app' })
1111

1212
// 定义路由,每个路由都需要映射到一个组件
1313
const routes = [

vite.config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import vue from '@vitejs/plugin-vue'
1111
import legacy from '@vitejs/plugin-legacy'
1212
import vueJsx from '@vitejs/plugin-vue-jsx'
1313

14-
import px2vw from '@yuo/postcss-px2vw'
14+
import viewport from 'postcss-mobile-forever'
1515
import autoprefixer from 'autoprefixer'
1616

1717
import { viteVConsole } from 'vite-plugin-vconsole'
@@ -80,8 +80,12 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
8080
postcss: {
8181
plugins: [
8282
autoprefixer(),
83-
px2vw({
83+
viewport({
84+
rootSelector: '#app',
8485
viewportWidth: 375,
86+
border: false,
87+
disableDesktop: false,
88+
disableLandscape: false,
8589
}),
8690
],
8791
},

0 commit comments

Comments
 (0)