01 / Overview
cu-promo-capsule-words
胶囊词条:单行 / 双行两态,可换一批。
会场
参考件 hallcapsule
1 档
已上线
02 / Demo
档位与实时预览
| 档位数 | 演示页 | 平台 |
|---|---|---|
| 1 | /pages/promo/venue?name=cu-promo-capsule-words | App / H5 / 微信 |
右侧的预览由站点脚本把 H5 演示页装进 iframe;切档位与主题在演示页顶部操作,不在此处留静态截图。
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| words | 词条数组(字符串);元素 '' + v 转换;空串元素不渲染 | Array | [] |
| lines | 1 / 2;其它值 → 2 + cuWarn 一次 | Number | 2 |
| showRefresh | 只在 lines == 2 生效;false 不渲染换一批 | Boolean | true |
| max | 最多显示条数;0 = 单行全显示 / 双行 12 条;< 0 按 0;超过可用条数按可用条数 | Number | 0 |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @change | 点击词条时触发,value 为原文 | value, index |
| @action | 点击换一批时触发,type 为 refresh | type, item, index |
slots
| 插槽 | 说明 |
|---|---|
| default | 整个组件替换 |
04 / Example
代码示例
<cu-promo-capsule-words :words="words" :lines="2" />
05 / Notes
注意事项
换一批只发事件,不改内部数据。
change.value 为未截断的词条原文。
安装 colorui-promo 全量包与安装任意 cu-promo-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。