Skip to content
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.

Commit

Permalink
refactor: update element reference to registerElement in multiple com…
Browse files Browse the repository at this point in the history
…ponents
  • Loading branch information
productdevbook committed Nov 19, 2024
1 parent 8234a84 commit c6e8c69
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .docs/components/demo/UseAnimate/tailwind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ onMounted(() => {

<template>
<div
:ref="scope.updateElement"
:ref="scope.registerElement"
class="bg-white w-1/3 aspect-square rounded-2xl"
/>
</template>
2 changes: 1 addition & 1 deletion .docs/components/demo/UseAnimateList/tailwind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ onMounted(() => {
</script>

<template>
<ul :ref="scope.updateElement"
<ul :ref="scope.registerElement"
class="grid grid-cols-4">
<li
v-for="i in 20"
Expand Down
2 changes: 1 addition & 1 deletion .docs/components/demo/UseAnimationList/tailwind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ onMounted(() => {
<Toast
v-model="open"
></Toast>
<ul :ref="scope.updateElement"
<ul :ref="scope.registerElement"
class="grid grid-cols-4">
<li
key="test"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/components/stories/demo/UseAnimate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ onMounted(() => {
</script>

<template>
<ul :ref="scope.updateElement">
<ul :ref="scope.registerElement">
@oku/motion useAnimate Demo
<li class="bg-red-500">
1
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/composables/useAnimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export function useAnimate() {
animations: {
[key: string]: AnimationPlaybackControls[]
}
updateElement: (el?: any) => void
registerElement: (el?: any) => void
}>({
animations: {},
updateElement(el?: any) {
registerElement(el?: any) {
scope.el = el
},
})
Expand Down

0 comments on commit c6e8c69

Please sign in to comment.