Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Invalid Reactive System #38

Open
sheepbox8646 opened this issue Oct 6, 2024 · 0 comments
Open

[Bug] Invalid Reactive System #38

sheepbox8646 opened this issue Oct 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@sheepbox8646
Copy link
Member

<script setup lang="ts">
import { defineAnimation, useMotion, usePlayer, useWidget } from '@vue-motion/core'
import { Group, Arc, Polygon, Line } from '@vue-motion/lib'
import { ref } from 'vue';

const { width, height } = useMotion()
width.value = 1600
height.value = 900

const x = ref(0)

const change = defineAnimation((_context, progress) => {
  x.value = progress * 4000
})

const root = useWidget('root')

const { useAnimation } = usePlayer()
useAnimation(root)
  .animate(change, { duration: 2 })

</script>

<template>
  <Group wid="root">
    <Arc :radius="200" :from="-90" :to="90"></Arc>
    <Polygon :points="[
      [-200, 0],
      [200, 0],
      [x, -200]
    ]"/>
    <Line :from="[0, 0]" :to="[x, -Math.sqrt(40000 - x * x)]" :border-color="'white'" :border-interval="[10, 10]"/>
  </Group>
</template>

The anticipate is that get the property change with x, but it failed.

If you are interested in this issue and wanna to solve it, please comment.

@sheepbox8646 sheepbox8646 added the bug Something isn't working label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant