Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions runtimes/overview/vue.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,36 @@ export default {
</script>
```

Here is an example using Vue 3.

```vue
<template>
<div>
<canvas ref="canvas" width="400" height="400"></canvas>
</div>
</template>

<script setup>
import { onMounted, ref } from 'vue'
import { Rive, Layout } from '@rive-app/canvas'

const props = defineProps({
src: String,
fit: String,
alignment: String
})
const canvas = ref()

onMounted(() => {
new Rive({
canvas: canvas.value,
src: props.src,
layout: new Layout({
fit: props.fit,
alignment: props.alignment,
}),
autoplay: true
})
})
</script>
```