-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
zuofenghua
committed
Dec 9, 2021
1 parent
a77ef4f
commit c4b762e
Showing
11 changed files
with
221 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<div> | ||
<div> | ||
<button @click="toggle()">toggle-ready</button> | ||
<span style="margin-left: 8px;">ready: {{ ready }}</span> | ||
</div> | ||
<p> | ||
UserName: <span>{{ loading ? 'loading' : data }}</span> | ||
</p> | ||
<button @click="run()">run</button> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useRequest, useToggle } from 'ahooks-vue'; | ||
import { getFullName } from './utils'; | ||
const { state: ready, toggle } = useToggle(); | ||
const { data, loading, run } = useRequest(getFullName, { | ||
manual: true, | ||
ready, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<div> | ||
<div> | ||
<button @click="toggle()">toggle-ready</button> | ||
<span style="margin-left: 8px;">ready: {{ ready }}</span> | ||
</div> | ||
<p> | ||
UserName: <span>{{ loading ? 'loading' : data }}</span> | ||
</p> | ||
<button @click="run()">run</button> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { useRequest, useToggle } from 'ahooks-vue'; | ||
import { getFullName } from './utils'; | ||
const { state: ready, toggle } = useToggle(); | ||
const { data, loading, run } = useRequest(getFullName, { | ||
manual: false, | ||
ready, | ||
}); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.