1、不能放到assets中 。static文件在src目录下。也可以将文件放到public
2、路径前面一定要对。../
3、 width: 100%;height: 100%;只是根据内容来展示大小。图片并不能百分百显示。需要加position;否则看不到图片
.container {
width: 100%;
height: 100%;
position:fixed;
top: 0;
left: 0;
background:url('../static/background.png') no-repeat;
}
在img中可以:
<img src="~assets/img/background.png" width="596px" height="427px"/>