From 6a53200ff38d77ce41cbc6fbeae09fac37cfa0ab Mon Sep 17 00:00:00 2001 From: hwj Date: Wed, 17 Jun 2026 16:47:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=A8=A1=E5=85=B7=E5=8F=B0?= =?UTF-8?q?=E8=B4=A6-=E8=BE=93=E5=85=A5=E6=A1=86=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages_function/pages/moldLedger/index.vue | 20 ++- .../sv-focus-no-keyboard/changelog.md | 9 ++ .../sv-focus-no-keyboard.vue | 100 +++++++++++++ .../sv-focus-no-keyboard/package.json | 88 ++++++++++++ .../sv-focus-no-keyboard/readme.md | 134 ++++++++++++++++++ 5 files changed, 347 insertions(+), 4 deletions(-) create mode 100644 src/uni_modules/sv-focus-no-keyboard/changelog.md create mode 100644 src/uni_modules/sv-focus-no-keyboard/components/sv-focus-no-keyboard/sv-focus-no-keyboard.vue create mode 100644 src/uni_modules/sv-focus-no-keyboard/package.json create mode 100644 src/uni_modules/sv-focus-no-keyboard/readme.md diff --git a/src/pages_function/pages/moldLedger/index.vue b/src/pages_function/pages/moldLedger/index.vue index 04740c5..209db96 100644 --- a/src/pages_function/pages/moldLedger/index.vue +++ b/src/pages_function/pages/moldLedger/index.vue @@ -5,6 +5,7 @@ + + + + diff --git a/src/uni_modules/sv-focus-no-keyboard/package.json b/src/uni_modules/sv-focus-no-keyboard/package.json new file mode 100644 index 0000000..a0b2234 --- /dev/null +++ b/src/uni_modules/sv-focus-no-keyboard/package.json @@ -0,0 +1,88 @@ +{ + "id": "sv-focus-no-keyboard", + "displayName": "输入框聚焦且阻止键盘弹出", + "version": "1.0.2", + "description": "使输入框在聚焦的同时,从根本上阻止软键盘弹出,并非是单纯的隐藏键盘", + "keywords": [ + "聚焦", + "键盘", + "光标", + "focus", + "keyboard" +], + "repository": "", + "engines": { + "HBuilderX": "^3.1.0" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y", + "alipay": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "y", + "app-nvue": "n", + "app-uvue": "n", + "app-harmony": "u" + }, + "H5-mobile": { + "Safari": "y", + "Android Browser": "y", + "微信浏览器(Android)": "y", + "QQ浏览器(Android)": "y" + }, + "H5-pc": { + "Chrome": "y", + "IE": "y", + "Edge": "y", + "Firefox": "y", + "Safari": "y" + }, + "小程序": { + "微信": "n", + "阿里": "n", + "百度": "n", + "字节跳动": "n", + "QQ": "n", + "钉钉": "n", + "快手": "n", + "飞书": "n", + "京东": "n" + }, + "快应用": { + "华为": "n", + "联盟": "n" + } + } + } + } +} \ No newline at end of file diff --git a/src/uni_modules/sv-focus-no-keyboard/readme.md b/src/uni_modules/sv-focus-no-keyboard/readme.md new file mode 100644 index 0000000..8fe2490 --- /dev/null +++ b/src/uni_modules/sv-focus-no-keyboard/readme.md @@ -0,0 +1,134 @@ +# sv-focus-no-keyboard + +### 兼容性 + +✅已兼容,❌未兼容 + +| VUE2 |VUE3 | Android(APP/H5) | iOS(APP/H5) | 小程序 | +|:---: |:---:| :---: | :---: | :---: | +| ✅ ️ | ✅️ | ✅ | ❌ | ❌ | + +- 本插件使用 [renderjs](https://uniapp.dcloud.net.cn/tutorial/renderjs.html#renderjs) +- nvue,小程序,无法使用 renderjs +- ios 由于固件限制聚焦必弹出键盘,本插件虽然能用,但本质上是通过设置输入框的 readonly 属性进行控制,会导致光标丢失,并非能像安卓那样完美兼容 + +### props + +| 属性名 | 类型 | 默认值 | 说明 | +| :--- | :--- | :--- | :--- | +| banSelector | String | | 禁止软键盘弹出的输入框 选择器,可见示例 | + +`被 banSelector 禁止的输入框,将永久不再弹出软键盘,除非通过下列 focus 方法重新主动聚焦` + +### event + +| 事件名 | 参数 | 说明 | +| :--- | :--- | :--- | +| focus | selector: String| 指定 选择器 的输入框聚焦,且禁止软键盘弹出,可见示例 | + +`focus 不影响用户手动点击输入框的聚焦行为,即用户仍可手动点击输入框进行聚焦并弹出软键盘` + +### 使用示例 + +``` + + + +``` + +### 注意 + +1. 必须指定给到实际可以聚焦的dom盒子,如:实际的input,textarea标签,或者editor组件下的.ql-editor盒子等 + +2. 在vue2下,部分非原生input标签,如uni-easyinput插件由于内部特殊处理,可能无法兼容阻止键盘弹出的问题;但是该问题在vue3下可能不会出现,所以建议使用vue3,或者尽量使用原生input等标签 + +### 结语 + +本插件免费开源,如若借鉴源码还请注明出处,未经授权禁止转载售卖等侵犯版权行为,谢谢! + +感谢您使用本插件,如果在使用过程中遇到任何问题,欢迎在评论区留言或加群讨论,制作不易,还望五星好评 🌟🌟🌟🌟🌟 + +欢迎进群🍌交流,🐧Q群: +- ①群:852637893 +- ②群:816646292 +- ③群:704990626 + +💬WX群可通过🐧Q群进入 \ No newline at end of file