반응형
Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | ||||
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 11 | 12 | 13 | 14 | 15 | 16 | 17 |
| 18 | 19 | 20 | 21 | 22 | 23 | 24 |
| 25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- pydantic
- fastapi
- build
- TensorFlow
- androidstudio
- react
- PYTHON
- 개발
- webpack
- centos
- xcode
- 네트워크
- localserver
- Chrome
- linux
- 오블완
- 맥
- MAC
- Android
- IOS
- 센토스
- unittest
- ReactNative
- vsCode
- VirtualBox
- MachineLearning
- node
- 티스토리챌린지
- 리눅스
Archives
- Today
- Total
로메오의 블로그
[Vue + typescript] text editor 사용하기 - tiptap 본문
반응형
tiptap 설치
$ npm install @tiptap/vue-2 @tiptap/starter-kit
tiptap 설정
<template>
<content>
<h2>게시판</h2>
<div class="wrap">
<v-form>
<v-row>
<v-col>
<v-subheader>내용</v-subheader>
<editor-content :editor="editor" />
</v-col>
</v-row>
</v-form>
</div>
</content>
</template>
<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import { Editor, EditorContent } from '@tiptap/vue-2'
import StarterKit from '@tiptap/starter-kit'
@Component({
components: {
EditorContent
}
})
export default class NoticeView extends Vue {
editor:Editor | null = null
mounted () {
this.editor = new Editor({
content: '<h1>안녕하세요.</h1>',
extensions: [
StarterKit
]
})
}
beforeDestroy () {
if (this.editor !== null) {
this.editor.destroy()
}
}
}
</script>

메뉴바 설정
https://tiptap.dev/examples/collaborative-editing

위와 같은 메뉴바를 설정해봅니다.

https://github.com/ueberdosis/tiptap/tree/main/demos/src/Examples/CollaborativeEditing/Vue
tiptap github 사이트에서
Examples > CollaborativeEditing > Vue 에서 내용을 가져와서 적용합니다.
반응형
'Frontend > Vue' 카테고리의 다른 글
| [Vue + typescript] filter 사용하기 (0) | 2022.06.22 |
|---|---|
| [Vue + typescript] text editor 사용하기 - TOAST UI Editor for Vue (0) | 2022.06.16 |
| [Vue + typescript] 숫자 tween (0) | 2022.05.11 |
| [Vue + typescript] transition (0) | 2022.05.04 |
| [Vue + typescript] dynamic Component 생성하기 (0) | 2022.05.04 |
Comments