Skip to content

Commit d25799a

Browse files
committed
docs: 📝 update documentation
1 parent 53db633 commit d25799a

File tree

5 files changed

+190
-172
lines changed

5 files changed

+190
-172
lines changed

docs/components/demo/DemoEditor.vue

Lines changed: 21 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -37,63 +37,50 @@
3737
@textChange="handleTextChange"
3838
:theme="selectedTheme"
3939
:toolbar="selectedToolbar"
40+
:modules="myModules"
4041
>
4142
</QuillEditor>
4243
</div>
4344
</div>
4445
</template>
4546

4647
<script lang="ts">
47-
import { Quill } from "@vueup/vue-quill";
48-
import { Delta } from "types-quill-delta";
49-
import { defineComponent, watch, ref } from "vue";
50-
import VOptions from "../VOptions.vue";
51-
import { deltaContent } from "./delta-content";
48+
import { defineComponent, watch, ref } from 'vue'
49+
import VOptions from '../VOptions.vue'
50+
import { deltaContent } from './delta-content'
51+
import BlotFormatter from 'quill-blot-formatter'
5252
5353
export default defineComponent({
5454
components: { VOptions },
5555
setup: () => {
56-
const myEditor = ref();
57-
58-
const myContent = ref(deltaContent);
59-
60-
const myHTML = ref<string>("");
61-
let myQuill: Quill | null = null;
62-
63-
const handleReady = (quill: Quill) => {
64-
myQuill = quill;
65-
};
66-
67-
const handleTextChange = (a: Delta, b: Delta, c: any) => {
68-
myHTML.value = myQuill?.root.innerHTML as string;
69-
};
70-
71-
const clickMe = () => {
72-
myHTML.value = myQuill?.root.innerHTML as string;
73-
console.log(myQuill?.root.innerHTML);
74-
};
56+
const myEditor = ref()
57+
const myContent = ref(deltaContent)
58+
const myModules = [
59+
'blotFormatter',
60+
BlotFormatter,
61+
{
62+
/* options */
63+
},
64+
]
7565
7666
// ============ OPTIONS =====================
77-
const selectedTheme = ref<string>("snow");
78-
const selectedToolbar = ref<string>("essential");
67+
const selectedTheme = ref<string>('snow')
68+
const selectedToolbar = ref<string>('essential')
7969
8070
watch([selectedTheme, selectedToolbar], () => {
81-
myEditor.value.reinit();
82-
});
71+
myEditor.value.reinit()
72+
})
8373
8474
return {
8575
selectedTheme,
8676
selectedToolbar,
8777
// ---------------
8878
myEditor,
89-
clickMe,
9079
myContent,
91-
myHTML,
92-
handleReady,
93-
handleTextChange,
94-
};
80+
myModules,
81+
}
9582
},
96-
});
83+
})
9784
</script>
9885

9986
<style>

0 commit comments

Comments
 (0)