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:
+32
-32
@@ -34,7 +34,7 @@ export default {
|
||||
return {
|
||||
list: [],
|
||||
loading: false,
|
||||
finished: false
|
||||
finished: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -49,9 +49,9 @@ export default {
|
||||
this.finished = true;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### Error Info
|
||||
@@ -73,17 +73,17 @@ export default {
|
||||
return {
|
||||
list: [],
|
||||
error: false,
|
||||
loading: false
|
||||
loading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onLoad() {
|
||||
fetchSomeThing().catch(() => {
|
||||
this.error = true;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
### PullRefresh
|
||||
@@ -108,7 +108,7 @@ export default {
|
||||
list: [],
|
||||
loading: false,
|
||||
finished: false,
|
||||
refreshing: false
|
||||
refreshing: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -133,9 +133,9 @@ export default {
|
||||
this.finished = false;
|
||||
this.loading = true;
|
||||
this.onLoad();
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
## API
|
||||
@@ -143,36 +143,36 @@ export default {
|
||||
### Props
|
||||
|
||||
| Attribute | Description | Type | Default |
|
||||
|------|------|------|------|
|
||||
| v-model | Whether to show loading info,the `load` event will not be triggered when loading | *boolean* | `false` |
|
||||
| finished | Whether loading is finished,the `load` event will not be triggered when finished | *boolean* | `false` |
|
||||
| error | Whether loading is error,the `load` event will be triggered only when error text clicked, the `sync` modifier is needed | *boolean* | `false` |
|
||||
| offset | The load event will be triggered when the distance between the scrollbar and the bottom is less than offset | *number \| string* | `300` |
|
||||
| loading-text | Loading text | *string* | `Loading...` |
|
||||
| finished-text | Finished text | *string* | - |
|
||||
| error-text | Error loaded text | *string* | - |
|
||||
| immediate-check | Whether to check loading position immediately after mounted | *boolean* | `true` |
|
||||
| direction | Scroll direction,can be set to `up` | *string* | `down` |
|
||||
| --- | --- | --- | --- |
|
||||
| v-model | Whether to show loading info,the `load` event will not be triggered when loading | _boolean_ | `false` |
|
||||
| finished | Whether loading is finished,the `load` event will not be triggered when finished | _boolean_ | `false` |
|
||||
| error | Whether loading is error,the `load` event will be triggered only when error text clicked, the `sync` modifier is needed | _boolean_ | `false` |
|
||||
| offset | The load event will be triggered when the distance between the scrollbar and the bottom is less than offset | _number \| string_ | `300` |
|
||||
| loading-text | Loading text | _string_ | `Loading...` |
|
||||
| finished-text | Finished text | _string_ | - |
|
||||
| error-text | Error loaded text | _string_ | - |
|
||||
| immediate-check | Whether to check loading position immediately after mounted | _boolean_ | `true` |
|
||||
| direction | Scroll direction,can be set to `up` | _string_ | `down` |
|
||||
|
||||
### Events
|
||||
|
||||
| Event | Description | Arguments |
|
||||
|------|------|------|
|
||||
| --- | --- | --- |
|
||||
| load | Triggered when the distance between the scrollbar and the bottom is less than offset | - |
|
||||
|
||||
### Methods
|
||||
|
||||
Use [ref](https://vuejs.org/v2/api/#ref) to get List instance and call instance methods
|
||||
|
||||
| Name | Description | Attribute | Return value |
|
||||
|------|------|------|------|
|
||||
| check | Check scroll position | - | - |
|
||||
| Name | Description | Attribute | Return value |
|
||||
| ----- | --------------------- | --------- | ------------ |
|
||||
| check | Check scroll position | - | - |
|
||||
|
||||
### Slots
|
||||
|
||||
| Name | Description |
|
||||
|------|------|
|
||||
| default | List content |
|
||||
| loading | Custom loading tips |
|
||||
| Name | Description |
|
||||
| -------- | -------------------- |
|
||||
| default | List content |
|
||||
| loading | Custom loading tips |
|
||||
| finished | Custom finished tips |
|
||||
| error | Custom error tips |
|
||||
| error | Custom error tips |
|
||||
|
||||
Reference in New Issue
Block a user