docs: add import when using Toast or Notify

This commit is contained in:
陈嘉涵
2020-01-18 08:25:24 +08:00
parent 78e4c153b1
commit 9bcfddc958
68 changed files with 206 additions and 149 deletions

View File

@@ -21,7 +21,9 @@ The `refresh` event will be triggered when pull refresh, you should set `v-model
</van-pull-refresh>
```
```javascript
```js
import { Toast } from 'vant';
export default {
data() {
return {
@@ -29,11 +31,10 @@ export default {
isLoading: false
}
},
methods: {
onRefresh() {
setTimeout(() => {
this.$toast('Refresh Success');
Toast('Refresh Success');
this.isLoading = false;
this.count++;
}, 1000);

View File

@@ -21,7 +21,9 @@ Vue.use(PullRefresh);
</van-pull-refresh>
```
```javascript
```js
import { Toast } from 'vant';
export default {
data() {
return {
@@ -29,11 +31,10 @@ export default {
isLoading: false
}
},
methods: {
onRefresh() {
setTimeout(() => {
this.$toast('刷新成功');
Toast('刷新成功');
this.isLoading = false;
this.count++;
}, 1000);