mirror of
https://github.com/youzan/vant.git
synced 2026-01-31 01:01:30 +08:00
docs: add import when using Toast or Notify
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user