实现效果:
<view class="userName"><van-field left-icon="{{loginUserNameIcon}}" clearable class="fieldName" value="{{ loginUserName }}" placeholder="请输入账号" border="{{ false }}" ></van-field>
</view>
<view class="userName"><van-field left-icon="{{passwordIcon}}" clearable type="password" class="fieldName" value="{{ loginPassword }}" placeholder="请输入密码" border="{{ false }}" bind:blur ="companyCodeInput"/>
</view>
data中定义:
data: {loginUserNameIcon:"/pages/img/username.png",passwordIcon:"/pages/img/psw.png",},