Skip to content

Commit

Permalink
docs: fix use-request auto collect deps context
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonYong committed Jun 1, 2023
1 parent 10fb0df commit 1d63c5a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/hooks/src/useRequest/docs/refreshDeps/demo/demo1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<vhp-button type="button" @click="count++">count is {{ count }}</vhp-button>
<div style="opacity: 0.6;"> count !==0 and count !==5 ready is true </div>
</div>
<br>
<br />
<vhp-button @click="() => (id = 1)">Change ID = 1</vhp-button>
<vhp-button @click="() => (id = 2)" style="margin-left: 16px;">Change ID = 2</vhp-button>
<vhp-button @click="() => (store.id = 1)" style="margin-left: 16px;">
Expand Down Expand Up @@ -77,7 +77,7 @@
})
const count = ref(0)

const ready = computed(() => count.value !== undefined)
const ready = computed(() => count.value !== 0 && count.value !== 5)
const { data, loading } = useRequest(
() => getUsername({ id: id.value, storeId: store.id, count: count.value }),
{
Expand All @@ -89,7 +89,6 @@
},
ready,
refreshDeps: true,
debounceWait: 1000,
},
)
</script>

0 comments on commit 1d63c5a

Please sign in to comment.