当前位置:网站首页>Mobile pixel adaptation scheme
Mobile pixel adaptation scheme
2020-11-06 22:11:00 【The front end of the attack】
rem
1. stay public Public of folder html Add the configuration
principle : Create and add in the root directory of the file font-size
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta name="description" content="Web site created using create-react-app" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<title>React App</title>
<script>
(function (w) {
var doc = w.document;
var docEl = doc.documentElement;
var timer;
function refersh() {
var width = docEl.getBoundingClientRect().width;
if (width > 750) {
width = 750;
}
var rem = width / 7.5;
docEl.style.fontSize = rem + "px";
}
w.addEventListener('resize', function () {
timer && clearTimeout(timer);
timer = setTimeout(refersh, 400)
})
w.addEventListener('pageshow', function () {
timer && clearTimeout(timer);
timer = setTimeout(refersh, 400)
})
})(window)
</script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>
2.
vm
vue-cli Automatic matching vm, Using third-party dependency packages
postcss-px-to-viewport stay vue.config.js Configuration in file :
const pxtovw = require('postcss-px-to-viewport')
module.exports = {
css: {
loaderOptions: {
css: {
// The options here are passed to css-loader
},
postcss: {
// The options here are passed to postcss-loader
plugins: [
new pxtovw({
unitToConvert: 'px',
viewportWidth: 375,
unitPrecision: 5,
propList: ['*'],
viewportUnit: 'vw',
fontViewportUnit: 'vw',
selectorBlackList: [],
minPixelValue: 1,
mediaQuery: false,
replace: true,
exclude: [/node_modules/]
})
]
}
}
}
}
版权声明
本文为[The front end of the attack]所创,转载请带上原文链接,感谢
边栏推荐
- Stm32f030c6t6 compatible to replace mm32spin05pf
- Call analysis of start method in JNI thread and callback analysis of run method
- Cloudquery v1.2.0 release
- Detailed software engineering -- the necessary graphs in each stage
- 超高频RFID医疗血液管理系统应用
- Message queue - Analysis
- Js字符串-String字符串对象方法
- 高速公路二维码定位报警系统
- Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
- Event monitoring problem
猜你喜欢
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
All the way, I was forced to talk about C code debugging skills and remote debugging
如何创建交互式内核密度图表
September 3, 2020: naked writing algorithm: loop matrix traversal.
The use of Xunwei imx6 development board device tree kernel menuconfig
Detailed software engineering -- the necessary graphs in each stage
The 4th China BIM (digital construction) manager Summit Forum will be held in Hangzhou in 2020
Zhou Jie: database system of East China Normal University
心理咨询app开发所具备的优点与功能
What is the tensor in tensorflow?
随机推荐
2020-08-29:进程线程的区别,除了包含关系之外的一些区别,底层详细信息?
Erd-online free online database modeling tool
Using iceberg on kubernetes to create a new generation of cloud original data Lake
Composition of MRAM cache
#JVM 类加载机制
打工人好物——磨炼钢铁意志就要这样高效的电脑
A good thing for working people -- to temper the will of iron and steel requires such an efficient computer
Stickinengine architecture 12 communication protocol
ES中删除索引的mapping字段时应该考虑的点
[elastic search engine]
Code generator plug-in and creator preform file analysis
[doodling the footprints of Internet of things] Introduction to Internet of things
WebAPI接口设计:SwaggerUI文档 / 统一响应格式 / 统一异常处理 / 统一权限验证
C and C / C + + mixed programming series 5 - GC collaboration of memory management
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
应用层软件开发教父教你如何重构,资深程序员必备专业技能
Nonvolatile MRAM memory used in all levels of cache
How does cglib implement multiple agents?
2020-08-20:GO语言中的协程与Python中的协程的区别?
[self taught unity2d legendary game development] map editor