当前位置:网站首页>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]所创,转载请带上原文链接,感谢
边栏推荐
- The Interpreter pattern of behavior pattern
- win7 APPCRASH(解决方法)(转)
- ES中删除索引的mapping字段时应该考虑的点
- The native API of the future trend of the front end: web components
- 细数软件工程----各阶段必不可少的那些图
- September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.
- Stm32f030k6t6 compatible replacement smart mm32f031k6t6
- STM32F030C6T6兼容替换MM32SPIN05PF
- Configuration of AP hotspot on xunwei-imx6ull development board
- The isolation level of transaction and its problems
猜你喜欢

What kind of music do you need to make for a complete game?

Windows 10 蓝牙管理页面'添加蓝牙或其他设备'选项点击无响应的解决方案

September 9, 2020: naked writing algorithm: two threads print numbers 1-100 in turn.

C and C / C + + mixed programming series 5 - GC collaboration of memory management

2020 database technology conference helps technology upgrade

August 30, 2020: naked write algorithm: the nearest common ancestor of two nodes in a binary tree.
![[doodling the footprints of Internet of things] Introduction to Internet of things](/img/3b/00bc81122d330c9d59909994e61027.jpg)
[doodling the footprints of Internet of things] Introduction to Internet of things

Jenkins installation and deployment process

2020-08-17:详细说下数据倾斜怎么解决?

Exclusive interview with Alibaba cloud database for 2020 PostgreSQL Asia Conference: Zeng Wenjing
随机推荐
An article taught you to download cool dog music using Python web crawler
Understanding formatting principles
Ora-02292: complete constraint violation (midbjdev2.sys_ C0020757) - subrecord found
2020-08-19:TCP是通过什么机制保障可靠性的?
The isolation level of transaction and its problems
C and C / C + + mixed programming series 5 - GC collaboration of memory management
Points to be considered when deleting mapping field of index in ES
汽车维修app开发的好处与功能
Nonvolatile MRAM memory used in all levels of cache
The role of theme music in games
高速公路二维码定位报警系统
August 24, 2020: what are small documents? What's wrong with a lot of small files? How to solve many small files? (big data)
QT audio and video development 46 video transmission UDP version
“非洲用户的付费意愿并不低”——专访四达时代研发总监张亮
How much disk space does a file of 1 byte actually occupy
What grammar is it? ]
2020-09-09:裸写算法:两个线程轮流打印数字1-100。
ES中删除索引的mapping字段时应该考虑的点
Nodejs中使用jsonwebtoken(JWT)生成token的场景使用
What is the tensor in tensorflow?