-
Notifications
You must be signed in to change notification settings - Fork 303
Expand file tree
/
Copy pathTextEditorFixedMenu.vue
More file actions
73 lines (72 loc) · 1.62 KB
/
TextEditorFixedMenu.vue
File metadata and controls
73 lines (72 loc) · 1.62 KB
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
<template>
<Menu v-if="fixedMenuButtons" :buttons="fixedMenuButtons" />
</template>
<script>
import Menu from './Menu.vue'
import { createEditorButton } from './utils'
export default {
name: 'TextEditorFixedMenu',
props: ['buttons'],
components: { Menu },
inject: ['editor'],
computed: {
fixedMenuButtons() {
if (!this.buttons) return false
let buttons
if (Array.isArray(this.buttons)) {
buttons = this.buttons
} else {
buttons = [
[
'Heading 1',
'Heading 2',
'Heading 3',
'Heading 4',
'Heading 5',
'Heading 6',
],
'Paragraph',
'Separator',
'Bold',
'Italic',
'Separator',
'Bullet List',
'Numbered List',
'Separator',
'Align Left',
'Align Center',
'Align Right',
'Align Justify',
'FontColor',
'Separator',
'Image',
'Video',
'Link',
'Blockquote',
'Code',
'Horizontal Rule',
[
'InsertTable',
'AddColumnBefore',
'AddColumnAfter',
'DeleteColumn',
'AddRowBefore',
'AddRowAfter',
'DeleteRow',
'MergeCells',
'SplitCell',
'ToggleHeaderColumn',
'ToggleHeaderRow',
'ToggleHeaderCell',
'DeleteTable',
],
'Separator',
'Undo',
'Redo',
]
}
return buttons.map(createEditorButton)
},
},
}
</script>