1、wxml:
<view class="position"> <input class="inputs psw" type="text" value="{{verificationCode}}" bindinput="verificationCodeChange" placeholder="请输入验证码"> </input> <image class="code-img" src="{{codeImg}}" bindtap="getCode"></image> </view>
2、scss:
.position{ position: relative; image { z-index: 10; position: absolute; top: 0; right: 0; padding: 30rpx; width: 40rpx; height: 40rpx; } .code-img { width: 150rpx; height: 70rpx; margin-top: -16rpx; } }