vue中<div>不能占满整个屏幕
1. css中设置div的样式position:fixed;及height:100%,width:100%
<template> <div class="html body"> </template> .html{ background:url('../img/bg.jpg') repeat center top #826e79; height: 100%; width: 100%; position: fixed; }
2、App.vue中设置body
body {
margin: 0;
padding: 0;
}