Commit c532b500634a0089cc91c6247f4dbdf05b86ca48
1 parent
39fa9c6d
fix: use rem for font-size
Showing
2 changed files
with
6 additions
and
5 deletions
back-end/h5-api/views/engine.ejs
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | <head> | 3 | <head> |
| 4 | <meta charset="UTF-8"> | 4 | <meta charset="UTF-8"> |
| 5 | <title>work.html</title> | 5 | <title>work.html</title> |
| 6 | - <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"> | 6 | + <!-- <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" name="viewport"> --> |
| 7 | <meta content="yes" name="apple-mobile-web-app-capable"> | 7 | <meta content="yes" name="apple-mobile-web-app-capable"> |
| 8 | <meta content="black" name="apple-mobile-web-app-status-bar-style"> | 8 | <meta content="black" name="apple-mobile-web-app-status-bar-style"> |
| 9 | <meta content="telephone=no" name="format-detection"> | 9 | <meta content="telephone=no" name="format-detection"> |
| @@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
| 12 | <!-- <script type="text/javascript" src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/flexible.js"></script> --> | 12 | <!-- <script type="text/javascript" src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/flexible.js"></script> --> |
| 13 | <!-- <link rel="stylesheet" href="/be-static/be-static-luban-h5/engine/engine.css"> --> | 13 | <!-- <link rel="stylesheet" href="/be-static/be-static-luban-h5/engine/engine.css"> --> |
| 14 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/css/swiper.min.css"> | 14 | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/css/swiper.min.css"> |
| 15 | - <link rel="stylesheet" href="https://meyerweb.com/eric/tools/css/reset/reset.css"> | 15 | + <!-- <link rel="stylesheet" href="https://meyerweb.com/eric/tools/css/reset/reset.css"> --> |
| 16 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js"></script> | 16 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/4.5.0/js/swiper.min.js"></script> |
| 17 | <script> | 17 | <script> |
| 18 | function setDocFontSize(base) { | 18 | function setDocFontSize(base) { |
| @@ -36,6 +36,7 @@ | @@ -36,6 +36,7 @@ | ||
| 36 | domEle.style.fontSize = w / base * 100 + "px"; | 36 | domEle.style.fontSize = w / base * 100 + "px"; |
| 37 | domEle.dataset.dpr = dpr; | 37 | domEle.dataset.dpr = dpr; |
| 38 | } | 38 | } |
| 39 | + setDocFontSize(320) | ||
| 39 | </script> | 40 | </script> |
| 40 | <script>window.__work = <%- JSON.stringify(work) %></script> | 41 | <script>window.__work = <%- JSON.stringify(work) %></script> |
| 41 | <script src="/engine-assets/engine.js"></script> | 42 | <script src="/engine-assets/engine.js"></script> |
| @@ -49,8 +50,8 @@ | @@ -49,8 +50,8 @@ | ||
| 49 | } | 50 | } |
| 50 | </style> | 51 | </style> |
| 51 | </head> | 52 | </head> |
| 52 | - | ||
| 53 | -<body onload="setDocFontSize(320)"> | 53 | +<!-- <body onload="setDocFontSize(320)"> --> |
| 54 | +<body> | ||
| 54 | <div id="app"> | 55 | <div id="app"> |
| 55 | <button class="swiper-button-next" style="position: fixed;left: 1000px">Next</button> | 56 | <button class="swiper-button-next" style="position: fixed;left: 1000px">Next</button> |
| 56 | <button class="swiper-button-prev" style="position: fixed;left: 1000px">Prev</button> | 57 | <button class="swiper-button-prev" style="position: fixed;left: 1000px">Prev</button> |
front-end/h5/src/components/core/models/element.js
| @@ -66,7 +66,7 @@ class Element { | @@ -66,7 +66,7 @@ class Element { | ||
| 66 | left: parsePx(pluginProps.left || commonStyle.left, isRem), | 66 | left: parsePx(pluginProps.left || commonStyle.left, isRem), |
| 67 | width: parsePx(pluginProps.width || commonStyle.width, isRem), | 67 | width: parsePx(pluginProps.width || commonStyle.width, isRem), |
| 68 | height: parsePx(pluginProps.height || commonStyle.height, isRem), | 68 | height: parsePx(pluginProps.height || commonStyle.height, isRem), |
| 69 | - fontSize: `${pluginProps.fontSize || commonStyle.fontSize}px`, | 69 | + fontSize: parsePx(pluginProps.fontSize || commonStyle.fontSize, isRem), |
| 70 | color: pluginProps.color || commonStyle.color, | 70 | color: pluginProps.color || commonStyle.color, |
| 71 | // backgroundColor: pluginProps.backgroundColor || commonStyle.backgroundColor, | 71 | // backgroundColor: pluginProps.backgroundColor || commonStyle.backgroundColor, |
| 72 | textAlign: pluginProps.textAlign || commonStyle.textAlign, | 72 | textAlign: pluginProps.textAlign || commonStyle.textAlign, |