更新记录

0.1.12(2026-08-01) 下载此版本

  • 修改文档,去掉系统判定的敏感词汇

0.1.11(2026-08-01) 下载此版本

  • 修复 Android 端单行和多行文本省略不生效:在 APP-ANDROID 下补充根节点宽度约束,并将原生 <text :lines> 与 CSS lines 双写;文本 flex 子项增加收缩约束。鸿蒙、Web 与微信小程序行为保持不变。

平台兼容性

uni-app x(4.25)

Chrome Safari Android iOS 鸿蒙 微信小程序
-

其他

多语言 暗黑模式 宽屏模式
× ×

nax-text

uni-app x 文本组件。

依赖

  • nax-icon(前/后缀图标)
  • nax-ui-theme(CSS 变量 --nax-*,弱依赖)

基础用法

<nax-text text="这是多行输入啊"></nax-text>
<nax-text type="primary" text="主题色"></nax-text>
<nax-text mode="price" text="128.5" type="error"></nax-text>
<nax-text mode="phone" format="encrypt" text="130xxxxxxxx"></nax-text>
<nax-text :lines="2" text="超出两行显示省略号……"></nax-text>

Props

属性 类型 默认 说明
type string default default / primary / info / success / warning / error / secondary / placeholder;兼容 main/content/tips/light/danger
show boolean true 是否显示
text string '' 文案
prefix-icon string '' 前置图标名(nax-icon)
suffix-icon string '' 后置图标名
mode string text text / price / phone / name / date / link
href string '' mode=link 链接
format string '' phone/nameencryptdate 用时间格式,默认 yyyy-mm-dd
call boolean false mode=phone 时点击拨号
bold boolean false 加粗
block boolean false 块级
lines number 0 最大行数,超出省略;0 不限制
color string '' 自定义颜色(优先于 type)
size string md sm(14) / md(16 默认) / lg(18) / xl(20) 或数字 px
decoration string none none / underline / line-through
align string left left / center / right
line-height string '' 行高
selectable boolean false 是否可选中
icon-size string '' 图标尺寸,默认跟随字号
icon-color string '' 图标颜色
custom-class string '' 根节点扩展 class

Events

事件 说明
click 点击;phone+call 会拨号,link 会打开/复制链接

插槽

名称 说明
default 文案后的附加内容
prefix 自定义前置区域
suffix 自定义后置区域

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。