在最外侧的盒子上绑定样式即可
<template>
<div class="bg">
...
</div>
</template>
<style>
.bg {
position: absolute;
width: 100%;
height: 100%;
margin: 0 auto;
background: url(../assets/login/bg.jpg) no-repeat center top;
background-size: cover;
overflow: hidden;
}
</style>
如果背景图仍然与边框存在缝隙,可以参考:vue-使页面元素与侧边不存在间距 这篇文章