-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathEditor.vue
38 lines (35 loc) · 973 Bytes
/
Editor.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
<template>
<d-card class="card-small mb-3">
<d-card-body>
<d-form class="add-new-post">
<d-input size="lg" class="mb-3" placeholder="Your Post Title" />
<div ref="editor" class="add-new-post__editor mb-1"></div>
</d-form>
</d-card-body>
</d-card>
</template>
<script>
import Quill from 'quill';
export default {
name: 'editor',
mounted() {
const toolbarOptions = [
[{ header: [1, 2, 3, 4, 5, false] }],
['bold', 'italic', 'underline', 'strike'],
['blockquote', 'code-block'],
[{ header: 1 }, { header: 2 }],
[{ list: 'ordered' }, { list: 'bullet' }],
[{ script: 'sub' }, { script: 'super' }],
[{ indent: '-1' }, { indent: '+1' }],
];
// Init the Quill RTE
new Quill(this.$refs.editor, {
modules: {
toolbar: toolbarOptions,
},
placeholder: 'Words can be like x-rays if you use them properly...',
theme: 'snow',
});
},
};
</script>