diff --git a/src/examples/treeview/directory.vue b/src/examples/treeview/directory.vue index dc9ec2720..1215ae638 100644 --- a/src/examples/treeview/directory.vue +++ b/src/examples/treeview/directory.vue @@ -126,14 +126,14 @@ }, methods: { - async fetchUsers () { + async fetchUsers (item) { // Remove in 6 months and say // you've made optimizations! :) await pause(1500) - fetch('https://jsonplaceholder.typicode.com/users') + return fetch('https://jsonplaceholder.typicode.com/users') .then(res => res.json()) - .then(json => (this.users = json)) + .then(json => (item.children.push(...json))) .catch(err => console.warn(err)) }, randomAvatar () { diff --git a/src/lang/en/components/Treeview.json b/src/lang/en/components/Treeview.json index 95dcc4684..e015c71a0 100644 --- a/src/lang/en/components/Treeview.json +++ b/src/lang/en/components/Treeview.json @@ -11,7 +11,7 @@ }, "directory": { "header": "Async items", - "desc": "Save requests by supplying a _Promise_ callback and load your data only if/when you need it" + "desc": "You can dynamically load child data by supplying a _Promise_ callback to the `load-children` prop. This callback will be executed the first time a user tries to expand an item that has a children property that is an empty array." }, "hotspots": { "header": "Custom selectable icons",