用html2canvas div生成图片
mask: linear-gradient 不生效
请问下是什么问题造成的,有没有其他好的方式将div生成图片
div的样式
<div class="img"></div>
.img {
position: relative;
width: 200px;
height: 200px;
background: url('@/assets/images/logo2.png');
background-size: cover;
border: solid 1px #ccc;
&::after {
content: '';
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: url('@/assets/images/test.jpg') no-repeat;
background-size: cover;
mask: linear-gradient(110deg, #000 10%, transparent 70%, transparent);
-webkit-mask: linear-gradient(110deg, #000 10%, transparent 70%, transparent);
}
}
你用的什么版本?版本>=1.3.2才会支持,并且可能有bug
https://github.com/niklasvh/h...