Skip to content

Commit

Permalink
fix: fix CountTo not working (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoxiayan authored May 4, 2022
1 parent 46465e5 commit 0a65d71
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/CountTo/src/CountTo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { TransitionPresets } from '@vueuse/core'
import { isNumber } from '~/utils/is'
interface Props {
export interface Props {
startVal?: number
endVal?: number
duration?: number
Expand Down
15 changes: 5 additions & 10 deletions src/views/demo/count-to/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,9 @@
-1000
</a-button>
</a-space>

<div class="mt-20px">
<a-card-grid style="width: 50%; text-align: center">
<count-to
:start-val="startVal"
:end-val="endVal"
prefix="$"
/>
<count-to :start-val="startVal" :end-val="endVal" prefix="$" />
</a-card-grid>
<a-card-grid style="width: 50%; text-align: center">
<count-to
Expand All @@ -28,7 +23,6 @@
</a-card-grid>
</div>
</a-card>

<a-card title="数字动画(手动)" class="enter-y !mt-16px">
<a-space>
<a-button @click="countToRef.start()">
Expand All @@ -38,7 +32,6 @@
重置
</a-button>
</a-space>

<div class="mt-20px">
<a-card-grid style="width: 100%; text-align: center">
<count-to
Expand All @@ -58,10 +51,12 @@
<script setup lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import { PageWrapper } from '~/components/Page'
import type { CountTo } from '~/components/CountTo'
import type { Props } from '~/components/CountTo'
import { CountTo } from '~/components/CountTo'
const startVal = ref(0)
const endVal = ref(6666)
const countToRef = ref<InstanceType<typeof CountTo> | null>(null)
const countToRef = ref<InstanceType<typeof Props> | null>(null)
</script>

0 comments on commit 0a65d71

Please sign in to comment.