页面代码:image1为静态图片,image2动态加载图片,没有图片则显示背景图。
<image style="margin: 9px; position: absolute; z-index: 1;"
src="../../static/select.png"></image>
<image style="width: 88px; height: 88px;" :src="titem.imgUrl"></image>
//给图片增加背景图
image {
width: 100%;
height: 350px;
z-index: 999;
background: url(../../static/sxpic.png) no-repeat;
background-size: 370px 240px;
}
想要实现点击添加按钮图片显示已选择。因为是提示信息为一张静态图片,也会带有背景,从而遮住了原来的图片。
需要给image1 去掉背景图background: none;
<image style="margin: 9px; position: absolute; z-index: 1; background: none;"src="../../static/select.png"></image>
<image style="width: 88px; height: 88px;" :src="titem.imgUrl"></image>
实现效果: