代码
html
<view class="inputRight" @click="chooseLevel">
<input class="class_input" type="text" placeholder="请选择" placeholder-class="p_class" v-model="levelTxt" style="user-select: none; pointer-events: none;"/>
<image src="../../static/images/icon_right.png" class="icon2"></image>
</view>
重点:
css
style="user-select: none; pointer-events: none;"
javascript
function chooseLevel() {
uni.showActionSheet({
title: '请选择',
itemList: ['分账人1', '分账人2'],
success: function(res) {
console.log(res);
if (res.tapIndex == 0) {
type.value = 3
levelTxt.value = '分账人1'
}
if (res.tapIndex == 1) {
type.value = 4
levelTxt.value = '分账人2'
}
}
})
}