0
点赞
收藏
分享

微信扫一扫

【css/vue】Vue组件中对body操作样式的一种解决方案

穆风1818 2023-01-07 阅读 96


由于vue组件中四周总会出现白空隙,而在vue中又没有像html中对body样式的修改,因此,需要通过一个最外的div来解决。

<template>


<div class="bg">
</div>
</template>


<style>
.bg{
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow-y: auto;
background-color: red;
}
</style>

举报

相关推荐

一种垂直越权的解决方案

0 条评论