diff options
Diffstat (limited to 'src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue')
-rw-r--r-- | src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue b/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue new file mode 100644 index 0000000..b153769 --- /dev/null +++ b/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue @@ -0,0 +1,17 @@ +<template> + <editor v-model:html="html" /> + <textarea-copyable :value="format(html, { parser: 'html', plugins: [htmlParser] })" language="html" /> +</template> + +<script setup lang="ts"> +import TextareaCopyable from '@/components/TextareaCopyable.vue'; +import { ref } from 'vue'; +import { format } from 'prettier'; +import htmlParser from 'prettier/parser-html'; +import { useStorage } from '@vueuse/core'; +import Editor from './editor/editor.vue'; + +const html = useStorage('html-wysiwyg-editor--html', '<h1>Hey!</h1><p>Welcome to this html wysiwyg editor</p>'); +</script> + +<style lang="less" scoped></style> |