task#14196,添加响应式判断,师傅表格数据调整
This commit is contained in:
@ -29,5 +29,32 @@
|
||||
}
|
||||
</script>
|
||||
<script src="https://webapi.amap.com/maps?v=1.4.15&key=2560bbf04daef66c810c5e6a97e8c508&plugin=AMap.Polyline"></script>
|
||||
|
||||
<script>
|
||||
// VConsole 默认会挂载到 `window.VConsole` 上
|
||||
// let vConsole = new window.VConsole();
|
||||
(function (doc, win) {
|
||||
let docEl = doc.documentElement
|
||||
let resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
|
||||
recalc = function () {
|
||||
var clientWidth = docEl.clientWidth;
|
||||
console.log("clientWidth",clientWidth)
|
||||
if (!clientWidth) return;
|
||||
if (clientWidth < 400) {
|
||||
clientWidth = 400;
|
||||
}
|
||||
docEl.style.fontSize = 20 * (clientWidth / 700) + 'px';
|
||||
};
|
||||
if (!doc.addEventListener) return;
|
||||
var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
if (isMobile) {// 是移动端不变
|
||||
|
||||
}else{
|
||||
win.addEventListener(resizeEvt, recalc, false);
|
||||
doc.addEventListener('DOMContentLoaded', recalc, false);
|
||||
}
|
||||
console.log("isMobile",isMobile)
|
||||
})(document, window);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user