-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathApp.vue
75 lines (71 loc) · 1.39 KB
/
App.vue
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
<div id="app">
<div class="editor">
<quill-editor
ref="quillEditor"
class="editor"
v-model="content"
:options="editorOption"
@blur="onEditorBlur($event)"
@focus="onEditorFocus($event)"
@ready="onEditorReady($event)"
/>
</div>
</div>
</template>
<script>
import "quill/dist/quill.core.css";
import "quill/dist/quill.snow.css";
import "quill/dist/quill.bubble.css";
import { quillEditor } from "quill-vuejs";
export default {
name: "App",
components: {
quillEditor,
},
data() {
return {
content: "<h2>I am Example</h2>",
editorOption: {
// Some Quill options...
},
};
},
methods: {
onEditorBlur(quill) {
console.log("editor blur!", quill);
},
onEditorFocus(quill) {
console.log("editor focus!", quill);
},
onEditorReady(quill) {
console.log("editor ready!", quill);
},
onEditorChange({ quill, html, text }) {
console.log("editor change!", quill, html, text);
this.content = html;
},
},
computed: {
editor() {
return this.$refs.quillEditor.quill;
},
},
mounted() {
console.log("this is current quill instance object", this.editor);
},
};
</script>
<style>
#app {
color: #2c3e50;
margin-top: 60px;
}
.quill-editor,
.content {
background-color: white;
}
.editor {
height: 500px;
}
</style>