mirror of
https://github.com/youzan/vant.git
synced 2026-05-16 01:07:43 +08:00
docs: prettier all markdown files
This commit is contained in:
+42
-34
@@ -19,8 +19,16 @@ Vue.use(GoodsActionIcon);
|
||||
<van-goods-action>
|
||||
<van-goods-action-icon icon="chat-o" text="Icon1" @click="onClickIcon" />
|
||||
<van-goods-action-icon icon="cart-o" text="Icon2" @click="onClickIcon" />
|
||||
<van-goods-action-button type="warning" text="Button1" @click="onClickButton" />
|
||||
<van-goods-action-button type="danger" text="Button2" @click="onClickButton" />
|
||||
<van-goods-action-button
|
||||
type="warning"
|
||||
text="Button1"
|
||||
@click="onClickButton"
|
||||
/>
|
||||
<van-goods-action-button
|
||||
type="danger"
|
||||
text="Button2"
|
||||
@click="onClickButton"
|
||||
/>
|
||||
</van-goods-action>
|
||||
```
|
||||
|
||||
@@ -34,9 +42,9 @@ export default {
|
||||
},
|
||||
onClickButton() {
|
||||
Toast('Click Button');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Icon Badge
|
||||
@@ -81,47 +89,47 @@ Use `badge` prop to show badge in icon
|
||||
### GoodsAction Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| safe-area-inset-bottom | Whether to enable bottom safe area adaptation | _boolean_ | `true` |
|
||||
|
||||
### GoodsActionIcon Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| text | Button text | *string* | - |
|
||||
| icon | Icon | *string* | - |
|
||||
| color `v2.4.2` | Icon color | *string* | `#323233` |
|
||||
| icon-class | Icon class name | *any* | `''` |
|
||||
| dot `2.5.5` | Whether to show red dot | *boolean* | - |
|
||||
| badge `2.5.6` | Content of the badge | *number \| string* | - |
|
||||
| url | Link | *string* | - |
|
||||
| to | Target route of the link, same as to of vue-router | *string \| object* | - |
|
||||
| replace | If true, the navigation will not leave a history record | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| text | Button text | _string_ | - |
|
||||
| icon | Icon | _string_ | - |
|
||||
| color `v2.4.2` | Icon color | _string_ | `#323233` |
|
||||
| icon-class | Icon class name | _any_ | `''` |
|
||||
| dot `2.5.5` | Whether to show red dot | _boolean_ | - |
|
||||
| badge `2.5.6` | Content of the badge | _number \| string_ | - |
|
||||
| url | Link | _string_ | - |
|
||||
| to | Target route of the link, same as to of vue-router | _string \| object_ | - |
|
||||
| replace | If true, the navigation will not leave a history record | _boolean_ | `false` |
|
||||
|
||||
### GoodsActionButton Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| text | Button text | *string* | - |
|
||||
| type | Button type, Can be set to `primary` `info` `warning` `danger` | *string* | `default` |
|
||||
| color `v2.1.8` | Button color, support linear-gradient | *string* | - |
|
||||
| icon `v2.4.4` | Left Icon | *string* | - |
|
||||
| primary | Is primary button (red color) | *boolean* | `false` |
|
||||
| disabled | Whether to disable button | *boolean* | `false` |
|
||||
| loading | Whether show loading status | *boolean* | `false` |
|
||||
| url | Link | *string* | - |
|
||||
| to | Target route of the link, same as to of vue-router | *string \| object* | - |
|
||||
| replace | If true, the navigation will not leave a history record | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| text | Button text | _string_ | - |
|
||||
| type | Button type, Can be set to `primary` `info` `warning` `danger` | _string_ | `default` |
|
||||
| color `v2.1.8` | Button color, support linear-gradient | _string_ | - |
|
||||
| icon `v2.4.4` | Left Icon | _string_ | - |
|
||||
| primary | Is primary button (red color) | _boolean_ | `false` |
|
||||
| disabled | Whether to disable button | _boolean_ | `false` |
|
||||
| loading | Whether show loading status | _boolean_ | `false` |
|
||||
| url | Link | _string_ | - |
|
||||
| to | Target route of the link, same as to of vue-router | _string \| object_ | - |
|
||||
| replace | If true, the navigation will not leave a history record | _boolean_ | `false` |
|
||||
|
||||
### GoodsActionIcon Slots
|
||||
|
||||
| Name | Description |
|
||||
|------|------|
|
||||
| default | Text |
|
||||
| icon | Custom icon |
|
||||
| Name | Description |
|
||||
| ------- | ----------- |
|
||||
| default | Text |
|
||||
| icon | Custom icon |
|
||||
|
||||
### GoodsActionButton Slots
|
||||
|
||||
| Name | Description |
|
||||
|------|------|
|
||||
| Name | Description |
|
||||
| ------- | -------------- |
|
||||
| default | Button content |
|
||||
|
||||
@@ -19,8 +19,16 @@ Vue.use(GoodsActionIcon);
|
||||
<van-goods-action>
|
||||
<van-goods-action-icon icon="chat-o" text="客服" @click="onClickIcon" />
|
||||
<van-goods-action-icon icon="cart-o" text="购物车" @click="onClickIcon" />
|
||||
<van-goods-action-button type="warning" text="加入购物车" @click="onClickButton" />
|
||||
<van-goods-action-button type="danger" text="立即购买" @click="onClickButton" />
|
||||
<van-goods-action-button
|
||||
type="warning"
|
||||
text="加入购物车"
|
||||
@click="onClickButton"
|
||||
/>
|
||||
<van-goods-action-button
|
||||
type="danger"
|
||||
text="立即购买"
|
||||
@click="onClickButton"
|
||||
/>
|
||||
</van-goods-action>
|
||||
```
|
||||
|
||||
@@ -34,9 +42,9 @@ export default {
|
||||
},
|
||||
onClickButton() {
|
||||
Toast('点击按钮');
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### 徽标提示
|
||||
@@ -85,47 +93,47 @@ export default {
|
||||
### GoodsAction Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `true` |
|
||||
| --- | --- | --- | --- |
|
||||
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` |
|
||||
|
||||
### GoodsActionIcon Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| text | 按钮文字 | *string* | - |
|
||||
| icon | 图标 | *string* | - |
|
||||
| color `v2.4.2` | 图标颜色 | *string* | `#323233` |
|
||||
| icon-class | 图标额外类名 | *any* | - |
|
||||
| dot `2.5.5` | 是否显示图标右上角小红点 | *boolean* | `false` |
|
||||
| badge `v2.5.6` | 图标右上角徽标的内容 | *number \| string* | - |
|
||||
| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | *number \| string* | - |
|
||||
| url | 点击后跳转的链接地址 | *string* | - |
|
||||
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - |
|
||||
| replace | 是否在跳转时替换当前页面历史 | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| text | 按钮文字 | _string_ | - |
|
||||
| icon | 图标 | _string_ | - |
|
||||
| color `v2.4.2` | 图标颜色 | _string_ | `#323233` |
|
||||
| icon-class | 图标额外类名 | _any_ | - |
|
||||
| dot `2.5.5` | 是否显示图标右上角小红点 | _boolean_ | `false` |
|
||||
| badge `v2.5.6` | 图标右上角徽标的内容 | _number \| string_ | - |
|
||||
| info | 图标右上角徽标的内容(已废弃,请使用 badge 属性) | _number \| string_ | - |
|
||||
| url | 点击后跳转的链接地址 | _string_ | - |
|
||||
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - |
|
||||
| replace | 是否在跳转时替换当前页面历史 | _boolean_ | `false` |
|
||||
|
||||
### GoodsActionButton Props
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| text | 按钮文字 | *string* | - |
|
||||
| type | 按钮类型,可选值为 `primary` `info` `warning` `danger` | *string* | `default` |
|
||||
| color `v2.1.8` | 按钮颜色,支持传入`linear-gradient`渐变色 | *string* | - |
|
||||
| icon `v2.4.4` | 左侧[图标名称](#/zh-CN/icon)或图片链接 | *string* | - |
|
||||
| disabled | 是否禁用按钮 | *boolean* | `false` | - |
|
||||
| loading | 是否显示为加载状态 | *boolean* | `false` | - |
|
||||
| url | 点击后跳转的链接地址 | *string* | - |
|
||||
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | *string \| object* | - |
|
||||
| replace | 是否在跳转时替换当前页面历史 | *boolean* | `false` |
|
||||
| --- | --- | --- | --- |
|
||||
| text | 按钮文字 | _string_ | - |
|
||||
| type | 按钮类型,可选值为 `primary` `info` `warning` `danger` | _string_ | `default` |
|
||||
| color `v2.1.8` | 按钮颜色,支持传入`linear-gradient`渐变色 | _string_ | - |
|
||||
| icon `v2.4.4` | 左侧[图标名称](#/zh-CN/icon)或图片链接 | _string_ | - |
|
||||
| disabled | 是否禁用按钮 | _boolean_ | `false` | - |
|
||||
| loading | 是否显示为加载状态 | _boolean_ | `false` | - |
|
||||
| url | 点击后跳转的链接地址 | _string_ | - |
|
||||
| to | 点击后跳转的目标路由对象,同 vue-router 的 [to 属性](https://router.vuejs.org/zh/api/#to) | _string \| object_ | - |
|
||||
| replace | 是否在跳转时替换当前页面历史 | _boolean_ | `false` |
|
||||
|
||||
### GoodsActionIcon Slots
|
||||
|
||||
| 名称 | 说明 |
|
||||
|------|------|
|
||||
| default | 文本内容 |
|
||||
| icon | 自定义图标 |
|
||||
| 名称 | 说明 |
|
||||
| ------- | ---------- |
|
||||
| default | 文本内容 |
|
||||
| icon | 自定义图标 |
|
||||
|
||||
### GoodsActionButton Slots
|
||||
|
||||
| 名称 | 说明 |
|
||||
|------|------|
|
||||
| 名称 | 说明 |
|
||||
| ------- | ------------ |
|
||||
| default | 按钮显示内容 |
|
||||
|
||||
Reference in New Issue
Block a user