mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
docs: prettier all markdown files
This commit is contained in:
@@ -32,25 +32,25 @@ Notify({ type: 'warning', message: 'Notify Message' });
|
||||
Notify({
|
||||
message: 'Custom Color',
|
||||
color: '#ad0000',
|
||||
background: '#ffe1e1'
|
||||
background: '#ffe1e1',
|
||||
});
|
||||
|
||||
Notify({
|
||||
message: 'Custom Duration',
|
||||
duration: 1000
|
||||
duration: 1000,
|
||||
});
|
||||
```
|
||||
|
||||
### $notify Method
|
||||
### \$notify Method
|
||||
|
||||
After import the Notify component, the $notify method is automatically mounted on Vue.prototype, making it easy to call within a vue component.
|
||||
After import the Notify component, the \$notify method is automatically mounted on Vue.prototype, making it easy to call within a vue component.
|
||||
|
||||
```js
|
||||
export default {
|
||||
mounted() {
|
||||
this.$notify('Notify Message');
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -58,7 +58,7 @@ export default {
|
||||
### Methods
|
||||
|
||||
| Methods | Attribute | Return value | Description |
|
||||
|------|------|------|------|
|
||||
| --- | --- | --- | --- |
|
||||
| Notify | `options | message` | notify instance | Show notify |
|
||||
| Notify.clear | - | `void` | Close notify |
|
||||
| Notify.setDefaultOptions | `options` | `void` | Set default options of all notifies |
|
||||
@@ -67,13 +67,13 @@ export default {
|
||||
### Options
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| type `v2.1.6` | Can be set to `primary` `success` `warning` | *string* | `danger` |
|
||||
| message | Message | *string* | - |
|
||||
| duration | Duration(ms), won't disappear if value is 0 | *number \| string* | `3000` |
|
||||
| color | Message color | *string* | `white` | |
|
||||
| background | Background color | *string* | - |
|
||||
| className | Custom className | *any* | - |
|
||||
| onClick | Callback function after click | *Function* | - |
|
||||
| onOpened | Callback function after opened | *Function* | - |
|
||||
| onClose | Callback function after close | *Function* | - |
|
||||
| --- | --- | --- | --- |
|
||||
| type `v2.1.6` | Can be set to `primary` `success` `warning` | _string_ | `danger` |
|
||||
| message | Message | _string_ | - |
|
||||
| duration | Duration(ms), won't disappear if value is 0 | _number \| string_ | `3000` |
|
||||
| color | Message color | _string_ | `white` | |
|
||||
| background | Background color | _string_ | - |
|
||||
| className | Custom className | _any_ | - |
|
||||
| onClick | Callback function after click | _Function_ | - |
|
||||
| onOpened | Callback function after opened | _Function_ | - |
|
||||
| onClose | Callback function after close | _Function_ | - |
|
||||
|
@@ -43,25 +43,25 @@ Notify({ type: 'warning', message: '通知内容' });
|
||||
Notify({
|
||||
message: '自定义颜色',
|
||||
color: '#ad0000',
|
||||
background: '#ffe1e1'
|
||||
background: '#ffe1e1',
|
||||
});
|
||||
|
||||
Notify({
|
||||
message: '自定义时长',
|
||||
duration: 1000
|
||||
duration: 1000,
|
||||
});
|
||||
```
|
||||
|
||||
### 组件内调用
|
||||
|
||||
引入 Notify 组件后,会自动在 Vue 的 prototype 上挂载 $notify 方法,便于在组件内调用。
|
||||
引入 Notify 组件后,会自动在 Vue 的 prototype 上挂载 \$notify 方法,便于在组件内调用。
|
||||
|
||||
```js
|
||||
export default {
|
||||
mounted() {
|
||||
this.$notify('提示文案');
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
### 方法
|
||||
|
||||
| 方法名 | 说明 | 参数 | 返回值 |
|
||||
|------|------|------|------|
|
||||
| --- | --- | --- | --- |
|
||||
| Notify | 展示提示 | `options | message` | notify 实例 |
|
||||
| Notify.clear | 关闭提示 | - | `void` |
|
||||
| Notify.setDefaultOptions | 修改默认配置,对所有 Notify 生效 | `options` | `void` |
|
||||
@@ -78,13 +78,13 @@ export default {
|
||||
### Options
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
|------|------|------|------|
|
||||
| type `v2.1.6` | 类型,可选值为 `primary` `success` `warning` | *string* | `danger` |
|
||||
| message | 展示文案,支持通过`\n`换行 | *string* | - |
|
||||
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | *number \| string* | `3000` |
|
||||
| color | 字体颜色 | *string* | `white` |
|
||||
| background | 背景颜色 | *string* | - |
|
||||
| className | 自定义类名 | *any* | - |
|
||||
| onClick | 点击时的回调函数 | *Function* | - |
|
||||
| onOpened | 完全展示后的回调函数 | *Function* | - |
|
||||
| onClose | 关闭时的回调函数 | *Function* | - |
|
||||
| --- | --- | --- | --- |
|
||||
| type `v2.1.6` | 类型,可选值为 `primary` `success` `warning` | _string_ | `danger` |
|
||||
| message | 展示文案,支持通过`\n`换行 | _string_ | - |
|
||||
| duration | 展示时长(ms),值为 0 时,notify 不会消失 | _number \| string_ | `3000` |
|
||||
| color | 字体颜色 | _string_ | `white` |
|
||||
| background | 背景颜色 | _string_ | - |
|
||||
| className | 自定义类名 | _any_ | - |
|
||||
| onClick | 点击时的回调函数 | _Function_ | - |
|
||||
| onOpened | 完全展示后的回调函数 | _Function_ | - |
|
||||
| onClose | 关闭时的回调函数 | _Function_ | - |
|
||||
|
Reference in New Issue
Block a user