01 / Overview
cu-shop-cart-bar-button
购物车底栏内的胶囊按钮:6 种底色、3 档高度、禁用态;作为 `cart-bar` 默认插槽的子件使用,点击只发 `click`。
交易
8 条 props
1 事件
已实现
02 / Demo
实时预览
演示页:/pages/shop/cart-bar-button。右侧的预览由站点脚本把 H5 演示页装进 iframe;数据与交互在演示页内操作,不在此处留静态截图。
依赖
- 基础件:无
- 实体:无
03 / Props · Events · Slots
全量契约
props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| text | 按钮文案;空字符串时按钮仍占位 | string | '' |
| type | 底色:default / primary / info / success / warning / error | string | 'default' |
| size | 高度:small 64rpx / normal 80rpx / large 96rpx | string | 'normal' |
| disabled | 禁用;点击不发 click | boolean | false |
| customStyle | 根节点自定义样式 | Object | {} |
| customClass | 根节点自定义类名 | string | '' |
| url | 透传字段,本件未接线 | string | '' |
| linkType | 透传字段,本件未接线 | string | 'navigateTo' |
events
| 事件 | 说明 | 载荷 |
|---|---|---|
| @click | 点按;disabled=true 时不发 | 无 |
slots
本件不提供插槽,内容全部由 props 驱动。
04 / Example
代码示例
<cu-shop-cart-bar-button text="加入购物车" type="primary" size="normal" @click="onAdd" />
05 / Notes
注意事项
形状固定为胶囊圆角,不提供直角档
type 传入未知值时保持 default 灰底
非 default 底色配白字,禁用态统一灰底灰字
不引图标字体、不请求接口、不持久化、不弹 toast
安装 colorui-shop 全量包与安装任意 cu-shop-* 单件包二选一,不要同时装。单件包的前提是已安装完整 colorui-x。