uniapp——input 禁止输入 ,但是可以点击(禁用、可点击)

代码

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'
			}
		}
	})
}
相关推荐
一份执念10 小时前
uni-app项目 (vue+vite + uni-UI)中引入umd格式JS文件,微信小程序中导入报错处理方案
前端·uni-app·echarts
PedroQue9916 小时前
V1.6.1性能优化:高频路径提速与代码精简
前端·uni-app
夏碧笔3 天前
uni-app跨端地图实战:用第三方LBS替代微信平台收费服务
uni-app
用户6990304848757 天前
try catch使用场景 处理同步代码错误兼容用的
javascript·uni-app
ITKEY_7 天前
uniapp微信开发者工具 更改AppID失败 touristappid
uni-app
Geek_Vison8 天前
APP瘦身实战:从80MB+砍到15MB——基于小程序容器技术剥离APP非核心业务的实践分享
小程序·uni-app·mpaas
CHB8 天前
HDC2026 演讲实录|AI 驱动的跨端进化:利用 uni-agent 快速构建高性能鸿蒙应用
uni-app·harmonyos
2501_915918419 天前
iOS App性能测试工具的实现方法与优化循环指南
android·ios·小程序·https·uni-app·iphone·webview
斯内普吖9 天前
(开源)高校素拓分管理系统小程序实战指南 基于 Java + SpringBoot + uni-app + Vue + MySQL
java·spring boot·mysql·小程序·uni-app·开源
海阔天空66889 天前
uniapp开启调试模式
uni-app·uniapp开启调试模式