docs: prettier all markdown files
This commit is contained in:
+43
-43
@@ -48,7 +48,7 @@ const coupon = {
|
||||
startAt: 1489104000,
|
||||
endAt: 1514592000,
|
||||
valueDesc: '1.5',
|
||||
unitDesc: '元'
|
||||
unitDesc: '元',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -56,8 +56,8 @@ export default {
|
||||
return {
|
||||
chosenCoupon: -1,
|
||||
coupons: [coupon],
|
||||
disabledCoupons: [coupon]
|
||||
}
|
||||
disabledCoupons: [coupon],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onChange(index) {
|
||||
@@ -66,9 +66,9 @@ export default {
|
||||
},
|
||||
onExchange(code) {
|
||||
this.coupons.push(coupon);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -76,53 +76,53 @@ export default {
|
||||
### CouponCell Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| title | Cell title | *string* | `Coupon` |
|
||||
| chosen-coupon | Index of chosen coupon | *number \| string* | `-1` |
|
||||
| coupons | Coupon list | *Coupon[]* | `[]` |
|
||||
| editable | Cell editable | *boolean* | `true` |
|
||||
| border | Whether to show innner border | *boolean* | `true` |
|
||||
| currency | Currency symbol | *string* | `¥` |
|
||||
| --- | --- | --- | --- |
|
||||
| title | Cell title | _string_ | `Coupon` |
|
||||
| chosen-coupon | Index of chosen coupon | _number \| string_ | `-1` |
|
||||
| coupons | Coupon list | _Coupon[]_ | `[]` |
|
||||
| editable | Cell editable | _boolean_ | `true` |
|
||||
| border | Whether to show innner border | _boolean_ | `true` |
|
||||
| currency | Currency symbol | _string_ | `¥` |
|
||||
|
||||
### CouponList Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| v-model | Current exchange code | *string* | - |
|
||||
| chosen-coupon | Index of chosen coupon | *number* | `-1` |
|
||||
| coupons | Coupon list | *Coupon[]* | `[]` |
|
||||
| disabled-coupons | Disabled coupon list | *Coupon[]* | `[]` |
|
||||
| enabled-title | Title of coupon list | *string* | `Available` | - |
|
||||
| disabled-title | Title of disabled coupon list | *string* | `Unavailable` | - |
|
||||
| exchange-button-text | Exchange button text | *string* | `Exchange` |
|
||||
| exchange-button-loading | Whether to show loading in exchange button | *boolean* | `false` |
|
||||
| exchange-button-disabled | Whether to disable exchange button | *boolean* | `false` |
|
||||
| exchange-min-length | Min length to enable exchange button | *number* | `1` |
|
||||
| displayed-coupon-index | Index of displayed coupon | *number* | - |
|
||||
| close-button-text | Close button text | *string* | `Close` |
|
||||
| input-placeholder | Input placeholder | *string* | `Coupon code` |
|
||||
| currency | Currency symbol | *string* | `¥` |
|
||||
| empty-image | Placeholder image when list is empty | *string* | `https://img.yzcdn.cn/vant/coupon-empty.png` |
|
||||
| show-count `v2.3.0` | Whether to show coupon count in tab title | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | Current exchange code | _string_ | - |
|
||||
| chosen-coupon | Index of chosen coupon | _number_ | `-1` |
|
||||
| coupons | Coupon list | _Coupon[]_ | `[]` |
|
||||
| disabled-coupons | Disabled coupon list | _Coupon[]_ | `[]` |
|
||||
| enabled-title | Title of coupon list | _string_ | `Available` | - |
|
||||
| disabled-title | Title of disabled coupon list | _string_ | `Unavailable` | - |
|
||||
| exchange-button-text | Exchange button text | _string_ | `Exchange` |
|
||||
| exchange-button-loading | Whether to show loading in exchange button | _boolean_ | `false` |
|
||||
| exchange-button-disabled | Whether to disable exchange button | _boolean_ | `false` |
|
||||
| exchange-min-length | Min length to enable exchange button | _number_ | `1` |
|
||||
| displayed-coupon-index | Index of displayed coupon | _number_ | - |
|
||||
| close-button-text | Close button text | _string_ | `Close` |
|
||||
| input-placeholder | Input placeholder | _string_ | `Coupon code` |
|
||||
| currency | Currency symbol | _string_ | `¥` |
|
||||
| empty-image | Placeholder image when list is empty | _string_ | `https://img.yzcdn.cn/vant/coupon-empty.png` |
|
||||
| show-count `v2.3.0` | Whether to show coupon count in tab title | _boolean_ | `true` |
|
||||
|
||||
### CouponList Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
|------|------|------|
|
||||
| --- | --- | --- |
|
||||
| change | Triggered when change chosen coupon | index: index of chosen coupon |
|
||||
| exchange | Triggered when exchange coupon | code: exchange code |
|
||||
|
||||
### Data Structure of Coupon
|
||||
|
||||
| Key | Description | Type |
|
||||
|------|------|------|
|
||||
| id | Id | *string* |
|
||||
| name | Name | *string* |
|
||||
| condition | Condition | *string* |
|
||||
| startAt | Start time (Timestmap, unit second) | *number* |
|
||||
| endAt | End time (Timestmap, unit second) | *number* |
|
||||
| description | Description | *string* |
|
||||
| reason | Unavailable reason | *string* |
|
||||
| value | Value | *number* |
|
||||
| valueDesc | Value Text | *string* |
|
||||
| unitDesc | Unit Text | *string* |
|
||||
| Key | Description | Type |
|
||||
| ----------- | ----------------------------------- | -------- |
|
||||
| id | Id | _string_ |
|
||||
| name | Name | _string_ |
|
||||
| condition | Condition | _string_ |
|
||||
| startAt | Start time (Timestmap, unit second) | _number_ |
|
||||
| endAt | End time (Timestmap, unit second) | _number_ |
|
||||
| description | Description | _string_ |
|
||||
| reason | Unavailable reason | _string_ |
|
||||
| value | Value | _number_ |
|
||||
| valueDesc | Value Text | _string_ |
|
||||
| unitDesc | Unit Text | _string_ |
|
||||
|
||||
@@ -48,7 +48,7 @@ const coupon = {
|
||||
startAt: 1489104000,
|
||||
endAt: 1514592000,
|
||||
valueDesc: '1.5',
|
||||
unitDesc: '元'
|
||||
unitDesc: '元',
|
||||
};
|
||||
|
||||
export default {
|
||||
@@ -56,8 +56,8 @@ export default {
|
||||
return {
|
||||
chosenCoupon: -1,
|
||||
coupons: [coupon],
|
||||
disabledCoupons: [coupon]
|
||||
}
|
||||
disabledCoupons: [coupon],
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onChange(index) {
|
||||
@@ -66,65 +66,65 @@ export default {
|
||||
},
|
||||
onExchange(code) {
|
||||
this.coupons.push(coupon);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### CouponCell Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| title | 单元格标题 | *string* | `优惠券` |
|
||||
| chosen-coupon | 当前选中优惠券的索引 | *number \| string* | `-1` |
|
||||
| coupons | 可用优惠券列表 | *Coupon[]* | `[]` |
|
||||
| editable | 能否切换优惠券 | *boolean* | `true` |
|
||||
| border | 是否显示内边框 | *boolean* | `true` |
|
||||
| currency | 货币符号 | *string* | `¥` | - |
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| ------------- | -------------------- | ------------------ | -------- |
|
||||
| title | 单元格标题 | _string_ | `优惠券` |
|
||||
| chosen-coupon | 当前选中优惠券的索引 | _number \| string_ | `-1` |
|
||||
| coupons | 可用优惠券列表 | _Coupon[]_ | `[]` |
|
||||
| editable | 能否切换优惠券 | _boolean_ | `true` |
|
||||
| border | 是否显示内边框 | _boolean_ | `true` |
|
||||
| currency | 货币符号 | _string_ | `¥` | - |
|
||||
|
||||
### CouponList Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| v-model | 当前输入的兑换码 | *string* | - |
|
||||
| chosen-coupon | 当前选中优惠券的索引 | *number* | `-1` |
|
||||
| coupons | 可用优惠券列表 | *Coupon[]* | `[]` |
|
||||
| disabled-coupons | 不可用优惠券列表 | *Coupon[]* | `[]` |
|
||||
| enabled-title | 可用优惠券列表标题 | *string* | `可使用优惠券` |
|
||||
| disabled-title | 不可用优惠券列表标题 | *string* | `不可使用优惠券` |
|
||||
| exchange-button-text | 兑换按钮文字 | *string* | `兑换` |
|
||||
| exchange-button-loading | 是否显示兑换按钮加载动画 | *boolean* | `false` |
|
||||
| exchange-button-disabled | 是否禁用兑换按钮 | *boolean* | `false` |
|
||||
| exchange-min-length | 兑换码最小长度 | *number* | `1` |
|
||||
| displayed-coupon-index | 滚动至特定优惠券位置 | *number* | - |
|
||||
| show-close-button | 是否显示列表底部按钮 | *boolean* | `true` |
|
||||
| close-button-text | 列表底部按钮文字 | *string* | `不使用优惠` |
|
||||
| input-placeholder | 输入框文字提示 | *string* | `请输入优惠码` |
|
||||
| show-exchange-bar | 是否展示兑换栏 | *boolean* | `true` |
|
||||
| currency | 货币符号 | *string* | `¥` |
|
||||
| empty-image `v2.1.0` | 列表为空时的占位图 | *string* | `https://img.yzcdn.cn/vant/coupon-empty.png` |
|
||||
| show-count `v2.3.0` | 是否展示可用 / 不可用数量 | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | 当前输入的兑换码 | _string_ | - |
|
||||
| chosen-coupon | 当前选中优惠券的索引 | _number_ | `-1` |
|
||||
| coupons | 可用优惠券列表 | _Coupon[]_ | `[]` |
|
||||
| disabled-coupons | 不可用优惠券列表 | _Coupon[]_ | `[]` |
|
||||
| enabled-title | 可用优惠券列表标题 | _string_ | `可使用优惠券` |
|
||||
| disabled-title | 不可用优惠券列表标题 | _string_ | `不可使用优惠券` |
|
||||
| exchange-button-text | 兑换按钮文字 | _string_ | `兑换` |
|
||||
| exchange-button-loading | 是否显示兑换按钮加载动画 | _boolean_ | `false` |
|
||||
| exchange-button-disabled | 是否禁用兑换按钮 | _boolean_ | `false` |
|
||||
| exchange-min-length | 兑换码最小长度 | _number_ | `1` |
|
||||
| displayed-coupon-index | 滚动至特定优惠券位置 | _number_ | - |
|
||||
| show-close-button | 是否显示列表底部按钮 | _boolean_ | `true` |
|
||||
| close-button-text | 列表底部按钮文字 | _string_ | `不使用优惠` |
|
||||
| input-placeholder | 输入框文字提示 | _string_ | `请输入优惠码` |
|
||||
| show-exchange-bar | 是否展示兑换栏 | _boolean_ | `true` |
|
||||
| currency | 货币符号 | _string_ | `¥` |
|
||||
| empty-image `v2.1.0` | 列表为空时的占位图 | _string_ | `https://img.yzcdn.cn/vant/coupon-empty.png` |
|
||||
| show-count `v2.3.0` | 是否展示可用 / 不可用数量 | _boolean_ | `true` |
|
||||
|
||||
### CouponList Events
|
||||
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
|------|------|------|
|
||||
| change | 优惠券切换回调 | index, 选中优惠券的索引 |
|
||||
| exchange | 兑换优惠券回调 | code, 兑换码 |
|
||||
| 事件名 | 说明 | 回调参数 |
|
||||
| -------- | -------------- | ----------------------- |
|
||||
| change | 优惠券切换回调 | index, 选中优惠券的索引 |
|
||||
| exchange | 兑换优惠券回调 | code, 兑换码 |
|
||||
|
||||
### Coupon 数据结构
|
||||
|
||||
| 键名 | 说明 | 类型 |
|
||||
|------|------|------|
|
||||
| id | 优惠券 id | *string* |
|
||||
| name | 优惠券名称 | *string* |
|
||||
| condition | 满减条件 | *string* |
|
||||
| startAt | 卡有效开始时间 (时间戳, 单位秒) | *number* |
|
||||
| endAt | 卡失效日期 (时间戳, 单位秒) | *number* |
|
||||
| description | 描述信息,优惠券可用时展示 | *string* |
|
||||
| reason | 不可用原因,优惠券不可用时展示 | *string* |
|
||||
| value | 折扣券优惠金额,单位分 | *number* |
|
||||
| valueDesc | 折扣券优惠金额文案 | *string* |
|
||||
| unitDesc | 单位文案 | *string* |
|
||||
| 键名 | 说明 | 类型 |
|
||||
| ----------- | ------------------------------- | -------- |
|
||||
| id | 优惠券 id | _string_ |
|
||||
| name | 优惠券名称 | _string_ |
|
||||
| condition | 满减条件 | _string_ |
|
||||
| startAt | 卡有效开始时间 (时间戳, 单位秒) | _number_ |
|
||||
| endAt | 卡失效日期 (时间戳, 单位秒) | _number_ |
|
||||
| description | 描述信息,优惠券可用时展示 | _string_ |
|
||||
| reason | 不可用原因,优惠券不可用时展示 | _string_ |
|
||||
| value | 折扣券优惠金额,单位分 | _number_ |
|
||||
| valueDesc | 折扣券优惠金额文案 | _string_ |
|
||||
| unitDesc | 单位文案 | _string_ |
|
||||
|
||||
Reference in New Issue
Block a user