更新记录
0.2.6(2026-09-10)
下载此版本
- 修复长按滚动页面时聚焦样式残留:根节点触摸预亮对齐 nax-input 机制——
touchstart 仅未聚焦时预亮并记录起点,focus 事件确认转正;新增 touchmove 位移超阈值(约 6px)判定为滚动/滑动手势撤回预亮样式,touchcancel 仅复位标记不撤样式(部分端点击也会派发且 focus 可能缺失)
readonly 不再点亮聚焦样式(原生 textarea 不可聚焦,点亮后无 focus 事件会残留),对齐 nax-input
- 各端行为一致(无条件编译差异):点击聚焦正常点亮,长按滚动样式撤回,真实聚焦后滚动不受影响
0.2.5(2026-09-01)
下载此版本
- 修复
modelValue 被外部置 null 时崩溃(Cannot read property length of null,同 nax-input 0.2.6 修复):useStorage 置 null 删除 key 等场景下 v-model 传入 null,innerValue 在初始化与 modelValue watch 双入口统一规整为空串;外部置 null 显示为空串,其它行为不变
0.2.4(2026-08-27)
下载此版本
- 聚焦样式时序对齐 nax-input:
- 根节点
touchstart 提前点亮聚焦样式,消除 App 端聚焦回调随键盘动画延迟导致的样式晚亮(约半秒)
- 失焦样式同步清除,移除
onBlur 150ms 延迟(textarea 无操作按钮,无需点击保留窗口)
查看更多
平台兼容性
uni-app x(4.25)
| Chrome |
Safari |
Android |
iOS |
鸿蒙 |
微信小程序 |
| √ |
√ |
√ |
√ |
√ |
√ |
其他
nax-textarea
多行文本域。
依赖
nax-ui-theme(CSS 变量 --nax-*,安装时依赖 / 运行时弱依赖)
Android 暗黑模式下跨组件 CSS 变量可能失效,请通过 custom-class 传入 nax-theme-dark。
基础用法
<nax-textarea v-model="value" placeholder="请输入内容"></nax-textarea>
<!-- 字数统计 -->
<nax-textarea v-model="value" count placeholder="请输入内容"></nax-textarea>
<!-- 自动增高 -->
<nax-textarea v-model="value" auto-height placeholder="请输入内容"></nax-textarea>
<!-- 仅下边框 -->
<nax-textarea v-model="value" border border-type="bottom" placeholder="下划线风格"></nax-textarea>
常用 Props
| 属性 |
类型 |
默认 |
说明 |
| modelValue |
string |
'' |
v-model 值 |
| placeholder |
string |
请输入内容 |
占位 |
| height |
string |
70 |
高度(数字按 px);auto-height 时为 min-height |
| confirm-type |
string |
return |
键盘右下角;默认 return 可回车换行;设为 done/search 等会当完成并可能失焦 |
| disabled |
boolean |
false |
禁用 |
| readonly |
boolean |
false |
只读 |
| count |
boolean |
false |
字数统计 |
| focus |
boolean |
false |
获取焦点 |
| auto-height |
boolean |
false |
自动增高 |
| maxlength |
number |
140 |
最大长度;-1 不限制 |
| border |
boolean |
true |
是否边框(支持 默认 surround) |
| border-type |
string |
surround |
surround 四边 / bottom 仅下边框 |
| border-color |
string |
'' |
边框色 |
| background |
string |
'' |
背景色 |
| size |
string |
md |
sm / md / lg |
| custom-class |
string |
'' |
根节点扩展 class |
更多键盘相关:cursor、cursor-spacing、selection-start、selection-end、show-confirm-bar、confirm-hold、adjust-position、hold-keyboard、fixed、placeholder-style。
事件
| 事件 |
说明 |
| update:modelValue |
v-model |
| input |
输入变化(当前值),输入过程中每次触发 |
| change |
失焦时内容与聚焦时不同才触发(当前值),对齐原生 input 语义 |
| focus / blur |
聚焦 / 失焦(当前值) |
| confirm |
键盘完成(当前值) |
| linechange |
行数变化(detail) |
| keyboardheightchange |
键盘高度变化(detail) |
| click |
点击 |
暂不支持(组件)
| 能力 |
原因 |
formatter |
UTS 不适合以 Function prop 透传 |
ignoreCompositionEvent |
合成输入处理端差异大,暂不做 |
placeholderClass |
样式隔离 2.0 下类穿透不稳定,请用 placeholder-style |
disableDefaultPadding |
uni-app x 原生 textarea 未统一提供 |
主题
通过 CSS 变量覆盖:
| Token |
用途 |
--nax-border-width |
边框粗细 |
--nax-color-bg |
背景色 |
--nax-color-bg-secondary |
次级背景色 |
--nax-color-border |
边框色 |
--nax-color-error |
错误色 |
--nax-color-primary |
主题主色 |
--nax-color-text |
主文字色 |
--nax-color-text-disabled |
禁用文字色 |
--nax-color-text-secondary |
次要文字色 |
--nax-opacity-disabled |
禁用透明度 |
--nax-textarea-bg |
多行输入框背景色 |
平台说明
- 基于原生
textarea,auto-height / 键盘相关能力随端差异以官方文档为准。
readonly 通过禁用原生编辑实现(样式弱于 disabled)。
- 鸿蒙端:原生
cursor-spacing 仍不支持。