html:
<div class="name"><label>姓名:</label><input type="text" class="ipt" v-model="name" /></div>
<div class="name"><label>电话:</label><input type="text" class="ipt" v-model="mobile" /></div>
sass:
.name:nth-of-type(2) {
&::before {
background: url('~@/static/images/index/index_phone.png') no-repeat;
background-size: 100% auto;
top: -30px;
left: -18px;
}
(不知道为啥用nth-child始终选不中,后来尝试了nth-of-type居然能选中了)