Skip to content

Commit

Permalink
docs: Added setup script syntax to Vue 3 install docs (#2324)
Browse files Browse the repository at this point in the history
  • Loading branch information
NuroDev authored Jan 3, 2022
1 parent 83ede65 commit 989c027
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/installation/vue3.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,26 @@ export default {
</script>
```

Or feel free to use the new [`<script setup>` syntax](https://v3.vuejs.org/api/sfc-script-setup.html).

```html
<template>
<editor-content :editor="editor" />
</template>

<script setup>
import { useEditor, EditorContent } from '@tiptap/vue-3'
import StarterKit from '@tiptap/starter-kit'
const editor = useEditor({
content: '<p>I’m running Tiptap with Vue.js. 🎉</p>',
extensions: [
StarterKit,
],
})
</script>
```

## 4. Add it to your app
Now, let’s replace the content of `src/App.vue` with the following example code to use our new `Tiptap` component in our app.

Expand Down

0 comments on commit 989c027

Please sign in to comment.