๋ฐ์ํ
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
- recordrtcpromiseshandler
- ๋ฐฉ์กํต์ ๋ํ
- script setup
- pixi
- pixi.js
- ๋ฐฉ์ก๋
- capela
- ๋ฐฉํต๋
- ํผ์๋ง
- ts-ebml
- ebml
- webm-duration-fix
- no schema entry found for unknown
- ์ฌ๋ ๊ธธ 15์ฝ์ค
- ์ถ์๊ณผ์
- Vue3
- recordrtc
- ๋ด๋ ์ฐ์ฑ
- 0์๋ฉ๋ถํ๊ธฐ
- the play() request was interrupted by a call to pause()
- ์นด์นด์ค๋ก๊ทธ์ธAPI
- pixi.js 7.2.0
- PIXI.Graphics
- renderTextrue
- pixi-viewport
- ritz calton
- ์ค๊ฐ๊ณผ์
- ๊ตญ๋ฆฝ์๊ฒฉ๋ํ
- ์ฌํ์ ๋ฑ๋ก
- tui-editor
Archives
- Today
- Total
yyZa
tui-editor (TOAST UI Editor) vue3 <script setup> ์ ์ฉ๋ฒ ๋ณธ๋ฌธ
๋ฐ์ํ
๐ฅtui-editor ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
https://github.com/nhn/tui.editor
GitHub - nhn/tui.editor: ๐๐ Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
๐๐ Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible. - GitHub - nhn/tui.editor: ๐๐ Markdown WYSIWYG Editor. GFM Standard + Chart & UML Extensible.
github.com
npm install --save @toast-ui/vue-editor
๐ฅ Vue3 ํ๋ก์ ํธ์ tui-editor๊ตฌ์ฑํ๊ธฐ
import Editor from '@toast-ui/editor';
import '@toast-ui/editor/dist/toastui-editor.css';
๐ฅ tui-editor ์ฌ์ฉ ์ด์
์ฒ์์ผ๋ก HTML Editor๋ฅผ ์ฌ์ฉํ๊ฑด Ck-editor์๋๋ฐ tui-editor๊ฐ ์ค์น๋ ์ฌ์ฉ๋ฒ์ ์์ด ๋ ๊ฐ๋จํ๊ณ ๋ช ๋ฃํ๊ธฐ ๋๋ฌธ์ ์ฌ์ฉํ๊ฒ ๋์์ต๋๋ค.
๐ฅtui-editor ์ ์ฉ ๋ฐฉ๋ฒ
tui-editor๊ฐ ๊ธฐ์กด vue2๊น์ง๋ ์ง์์ ํ์์ผ๋ vue3๋ถํฐ๋ vue3์ ํจ๊ป Tui.Editor๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์ง์ ๋ํผ ํด์ผํฉ๋๋ค.
<template>
// ref์ฌ์ฉํ์ฌ ์๋ํฐ value ์ ์ฉ
<div ref="editor" />
//์์ฑํ ๋ด์ฉ ๋ถ๋ฌ์์ html ์ ์ฉ
<div v-html="testHtml.value"></div>
</template>
<scipt setup>
import { onMounted, ref, watch, onUnmounted } from 'vue';
import Editor from '@toast-ui/editor';
import '@toast-ui/editor/dist/toastui-editor.css';
const props = defineProps({
modelValue: {
type: String,
required: false,
default: '',
},
});
const emit = defineEmits(['update:modelValue']);
const editor = ref();
const editorValid = ref();
const testHtml = ref();
//๋ง์ดํธ๋ ๋ Editor ์์ฑ
onMounted(() => {
editorValid.value = new Editor({
el: editor.value,
height: '500px',
//'wysiwyg', 'markdown' ํ 1
initialEditType: 'wysiwyg',
events: {
change: () => emit('update:modelValue', editorValid.value.getMarkdown()),
},
});
});
//์์ฑํ ๋ด์ฉ ๋ถ๋ฌ์์ html ์ ์ฉ
const testValid = (e) => {
testHtml.value = editorValid.value.getHTML()
};
</script>
์ฃผ์ํ ์ ์ onMounted ๋ ๋ editor๋ฅผ ์ ์ฉํ๋ฏ๋ก ์ ์ฉํ ํด๋น elements๊ฐ Hide๋์ด์์์ ์๋ฌ ๋ฐ์
๋ฐ์ํ