Commit 4387946b authored by 郭志伟's avatar 郭志伟

perf(transformStyle): 组件高度向上取整

parent d9af2c09
......@@ -13,6 +13,7 @@ export default class TransformStyleMixin extends Vue {
if (!styleObj) { return style; }
for (const key of Object.keys(styleObj)) {
if ( typeof styleObj[key] === 'number') {
if (key === 'height') styleObj[key] = Math.ceil(styleObj[key]);
style[key] = `${(styleObj[key] / 37.5).toFixed(2)}rem`;
} else {
style[key] = styleObj[key]?.includes('px') ? `${(+(styleObj[key].slice(0, -2)) / 37.5).toFixed(2)}rem` : styleObj[key];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment