aboutsummaryrefslogtreecommitdiff
path: root/src/tools/html-wysiwyg-editor/html-wysiwyg-editor.vue
blob: 7cd12566089aa9f3d7a4e91c0b742a13a5a9fb7f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<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 { 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>