新版式
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/* Echarts图表尺寸自适应 */
|
||||
export const fitChartSize = (size, width = 3822) => {
|
||||
export const fitChartSize = (size, width = 3840) => {
|
||||
let clientWidth =
|
||||
window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth
|
||||
if (!clientWidth) return size
|
||||
let scale = clientWidth / width
|
||||
return Number((size * scale).toFixed(3))
|
||||
return Number((size * scale).toFixed(3))*1.4
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
//默认设计稿的宽度
|
||||
const designWidth = 3822
|
||||
const designWidth = 3840
|
||||
//默认设计稿的高度
|
||||
const designHeight = 1080
|
||||
const designHeight = 2160
|
||||
|
||||
let styleUtil = {
|
||||
// px转vw
|
||||
px2vw: function (_px) {
|
||||
return ((_px * 100.0) / designWidth).toFixed(3) + 'vw'
|
||||
return ((_px * 100.0*4) / designWidth).toFixed(3) + 'vw'
|
||||
},
|
||||
// px转vh
|
||||
px2vh: function (_px) {
|
||||
return ((_px * 100.0) / designHeight).toFixed(3) + 'vh'
|
||||
return ((_px * 100.0*4) / designHeight).toFixed(3) + 'vh'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user