[Doc] new theme

This commit is contained in:
陈嘉涵
2019-05-15 20:53:04 +08:00
parent 3cae4288f2
commit d0f4169c86
130 changed files with 1460 additions and 1147 deletions
+12 -11
View File
@@ -1,4 +1,4 @@
## Toast
# Toast
### Install
@@ -8,16 +8,15 @@ import { Toast } from 'vant';
Vue.use(Toast);
```
### Usage
## Usage
#### Text
### Text
```javascript
Toast('Some messages');
```
#### Loading
### Loading
```javascript
Toast.loading({
@@ -26,16 +25,14 @@ Toast.loading({
});
```
#### Success/Fail
### Success/Fail
```javascript
Toast.success('Success');
Toast.fail('Fail');
```
#### Advanced Usage
### Advanced Usage
```javascript
const toast = Toast.loading({
@@ -57,7 +54,8 @@ const timer = setInterval(() => {
}, 1000);
```
#### $toast Method
### $toast Method
After import the Toast component, the $toast method is automatically mounted on Vue.prototype, making it easy to call within a vue component.
```js
@@ -68,7 +66,8 @@ export default {
}
```
#### Singleton
### Singleton
Toast use singleton mode by default, if you need to pop multiple Toast at the same time, you can refer to the following example
```js
@@ -81,6 +80,8 @@ toast1.clear();
toast2.clear();
```
## API
### Methods
| Methods | Attribute | Return value | Description |
+13 -9
View File
@@ -1,6 +1,6 @@
## Toast 轻提示
# Toast 轻提示
### 使用指南
### 引入
```javascript
import { Toast } from 'vant';
@@ -8,15 +8,15 @@ import { Toast } from 'vant';
Vue.use(Toast);
```
### 代码演示
## 代码演示
#### 文字提示
### 文字提示
```javascript
Toast('提示内容');
```
#### 加载提示
### 加载提示
```javascript
Toast.loading({
@@ -25,14 +25,14 @@ Toast.loading({
});
```
#### 成功/失败提示
### 成功/失败提示
```javascript
Toast.success('成功文案');
Toast.fail('失败文案');
```
#### 高级用法
### 高级用法
```javascript
const toast = Toast.loading({
@@ -54,7 +54,8 @@ const timer = setInterval(() => {
}, 1000);
```
#### 组件内调用
### 组件内调用
引入 Toast 组件后,会自动在 Vue 的 prototype 上挂载 $toast 方法,便于在组件内调用。
```js
@@ -65,7 +66,8 @@ export default {
}
```
#### 单例模式
### 单例模式
Toast 默认采用单例模式,即同一时间只会存在一个 Toast,如果需要在同一时间弹出多个 Toast,可以参考下面的示例
```js
@@ -78,6 +80,8 @@ toast1.clear();
toast2.clear();
```
## API
### 方法
| 方法名 | 参数 | 返回值 | 介绍 |