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

How to import individual shapes in vue3 ? #222

Open
geminigeek opened this issue Sep 4, 2023 · 0 comments
Open

How to import individual shapes in vue3 ? #222

geminigeek opened this issue Sep 4, 2023 · 0 comments

Comments

@geminigeek
Copy link

geminigeek commented Sep 4, 2023

hi,

i am trying to use konva , in astro with vue, i do not want to bind it to the whole vue app , can anyone help me how to use it in just one component ?
i want to use it like this

related to this #144 (comment)

<script setup>
import { ref } from "vue"
import { VCircle, VLayer, VStage } from "vue-konva"
const configKonva = ref({
  width: 200,
  height: 200,
})
const stage = ref()
const layer = ref()
const circle = ref()
const configCircle = ref({
  x: 100,
  y: 100,
  radius: 70,
  fill: "red",
  stroke: "black",
  strokeWidth: 4,
})
</script>
<template>
  <v-stage ref="stage" :config="configKonva">
    <v-layer ref="layer">
      <v-circle ref="circle" :config="configCircle"></v-circle>
    </v-layer>
  </v-stage>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant