Skip to content

Commit cf70611

Browse files
committed
fix: ref
1 parent 99bd87f commit cf70611

File tree

5 files changed

+30
-25
lines changed

5 files changed

+30
-25
lines changed

app/components/shapes/HeadCircle.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ export default defineComponent({
3535
3636
setup(props, setupContext) {
3737
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
38-
const refs = setupContext.refs
38+
const shape = ref()
3939
4040
const KEY_FRAME = [0, 60]
4141
4242
const transform = transformPosition(props)
4343
4444
const createAnimations = () => {
4545
setTimeout(() => {
46-
createAnimation(refs.shape, { r: KEY_FRAME[1] })
46+
createAnimation(shape.value, { r: KEY_FRAME[1] })
4747
}, 0)
4848
}
4949
5050
const fadeAnimations = () => {
51-
fadeAnimation(refs.shape, { r: KEY_FRAME[0] })
51+
fadeAnimation(shape.value, { r: KEY_FRAME[0] })
5252
}
5353
5454
onMounted(() => {

app/components/shapes/HeadCross.vue

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ export default defineComponent({
4949
5050
setup(props, setupContext) {
5151
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
52-
const refs = setupContext.refs
52+
const shape1 = ref()
53+
const shape2 = ref()
54+
const shape3 = ref()
55+
const shape4 = ref()
5356
5457
const KEY_FRAME1 = ['0 -60 0 -60 0 -60', '-54 -60 54 -60 0 -6']
5558
const KEY_FRAME2 = ['-60 0 -60 0 -60 0', '-60 -54 -60 54 -6 0']
@@ -60,18 +63,18 @@ export default defineComponent({
6063
6164
const createAnimations = () => {
6265
setTimeout(() => {
63-
createAnimation(refs.shape1, { points: KEY_FRAME1[1] })
64-
createAnimation(refs.shape2, { points: KEY_FRAME2[1] })
65-
createAnimation(refs.shape3, { points: KEY_FRAME3[1] })
66-
createAnimation(refs.shape4, { points: KEY_FRAME4[1] })
66+
createAnimation(shape1.value, { points: KEY_FRAME1[1] })
67+
createAnimation(shape2.value, { points: KEY_FRAME2[1] })
68+
createAnimation(shape3.value, { points: KEY_FRAME3[1] })
69+
createAnimation(shape4.value, { points: KEY_FRAME4[1] })
6770
}, 0)
6871
}
6972
7073
const fadeAnimations = () => {
71-
fadeAnimation(refs.shape1, { points:KEY_FRAME1[0] })
72-
fadeAnimation(refs.shape2, { points:KEY_FRAME2[0] })
73-
fadeAnimation(refs.shape3, { points:KEY_FRAME3[0] })
74-
fadeAnimation(refs.shape4, { points:KEY_FRAME4[0] })
74+
fadeAnimation(shape1.value, { points:KEY_FRAME1[0] })
75+
fadeAnimation(shape2.value, { points:KEY_FRAME2[0] })
76+
fadeAnimation(shape3.value, { points:KEY_FRAME3[0] })
77+
fadeAnimation(shape4.value, { points:KEY_FRAME4[0] })
7578
}
7679
7780
onMounted(() => {

app/components/shapes/HeadHorizontal.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,22 @@ export default defineComponent({
4444
},
4545
setup(props, setupContext) {
4646
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
47-
const refs = setupContext.refs
47+
const shape1 = ref()
48+
const shape2 = ref()
4849
4950
const transform = transformPosition(props)
5051
5152
5253
const createAnimations = () => {
5354
setTimeout(() => {
54-
createAnimation(refs.shape1, { height: 55 })
55-
createAnimation(refs.shape2, { y: 5, height: 55 })
55+
createAnimation(shape1.value, { height: 55 })
56+
createAnimation(shape2.value, { y: 5, height: 55 })
5657
}, 0)
5758
}
5859
5960
const fadeAnimations = () => {
60-
fadeAnimation(refs.shape1, { y: -60, height: 0 })
61-
fadeAnimation(refs.shape1, { y: 60, height: 0 })
61+
fadeAnimation(shape1.value, { y: -60, height: 0 })
62+
fadeAnimation(shape2.value, { y: 60, height: 0 })
6263
}
6364
6465
onMounted(() => {

app/components/shapes/HeadSlash.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export default defineComponent({
3939
4040
setup(props, setupContext) {
4141
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
42-
const refs = setupContext.refs
42+
const shape1 = ref()
43+
const shape2 = ref()
4344
4445
const KEY_FRAME1 = ['-60 -60 -60 -60 -60 -60', '-60 -60 54 -60 -60 54']
4546
const KEY_FRAME2 = ['60 60 60 60 60 60', '60 60 -54 60 60 -54']
@@ -58,14 +59,14 @@ export default defineComponent({
5859
5960
const createAnimations = () => {
6061
setTimeout(() => {
61-
createAnimation(refs.shape1, { points: KEY_FRAME1[1] })
62-
createAnimation(refs.shape2, { points: KEY_FRAME2[1] })
62+
createAnimation(shape1.value, { points: KEY_FRAME1[1] })
63+
createAnimation(shape2.value, { points: KEY_FRAME2[1] })
6364
}, 0)
6465
}
6566
6667
const fadeAnimations = () => {
67-
fadeAnimation(refs.shape1, { points: KEY_FRAME1[0] })
68-
fadeAnimation(refs.shape2, { points: KEY_FRAME2[0] })
68+
fadeAnimation(shape1.value, { points: KEY_FRAME1[0] })
69+
fadeAnimation(shape2.value, { points: KEY_FRAME2[0] })
6970
}
7071
7172
onMounted(() => {

app/components/shapes/HeadTriangle.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ export default defineComponent({
3333
3434
setup(props, setupContext) {
3535
const { createAnimation, fadeAnimation, transformPosition } = useAnimationParts()
36-
const refs = setupContext.refs
36+
const shape = ref()
3737
3838
const KEY_FRAME = ['60 60 60 60 60 60', '60 60 -52 60 60 -52']
3939
4040
const transform = transformPosition(props)
4141
4242
const createAnimations = () => {
4343
setTimeout(() => {
44-
createAnimation(refs.shape, { points: KEY_FRAME[1] })
44+
createAnimation(shape.value, { points: KEY_FRAME[1] })
4545
}, 0)
4646
}
4747
4848
const fadeAnimations = () => {
49-
fadeAnimation(refs.shape, { points: KEY_FRAME[0] })
49+
fadeAnimation(shape.value, { points: KEY_FRAME[0] })
5050
}
5151
5252
onMounted(() => {

0 commit comments

Comments
 (0)