Skip to content

Commit 200bcbb

Browse files
committed
feat:rem适配
1 parent 68d351c commit 200bcbb

File tree

3 files changed

+73
-72
lines changed

3 files changed

+73
-72
lines changed

package-lock.json

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

public/index.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,16 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0, maxium-scale=1.0, minimum-scale=1.0, viewport-fit=cover">
77
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
88
<title><%= htmlWebpackPlugin.options.title %></title>
9-
<script>
9+
<!-- <script>
1010
function setRem () {
11-
const baseSize = 37.5
1211
var width = document.documentElement.clientWidth || document.body.clientWidth
1312
var ratio = width / 375
14-
var fontSize = baseSize * ratio
13+
var fontSize = 100 * ratio
1514
document.getElementsByTagName('html')[0].style['font-size'] = fontSize + 'px'
1615
}
1716
setRem()
1817
window.addEventListener('resize', setRem)
19-
</script>
18+
</script> -->
2019
</head>
2120
<body>
2221
<noscript>

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Vant from 'vant'
1010
import 'vant/lib/index.css'
1111
import 'normalize.css'
1212
import '@/styles/index.scss'
13-
import 'amfe-flexible'
13+
import 'amfe-flexible/index.js'
1414

1515
import '@/router/permission'
1616

0 commit comments

Comments
 (0)