File tree Expand file tree Collapse file tree 6 files changed +91
-8
lines changed Expand file tree Collapse file tree 6 files changed +91
-8
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
3
<button @click =" deleteImage" >Delete</button >
4
- <VueEditor
4
+ <!-- < VueEditor
5
5
ref="vEditor"
6
6
v-model="content"
7
7
use-custom-image-handler
8
- use-markdown-shortcuts
9
8
@focus="onEditorFocus"
10
9
@blur="onEditorBlur"
11
10
@imageAdded="handleImageAdded"
12
11
@image-removed="handleImageRemoved"
13
- />
12
+ /> -->
13
+
14
+ <NEditor v-model =" content" />
14
15
</div >
15
16
</template >
16
17
Original file line number Diff line number Diff line change
1
+ /* eslint-disable no-console */
2
+ import Vue from "vue" ;
3
+
4
+ let Quill ;
5
+ if ( ! Vue . prototype . $isServer ) Quill = require ( "quill" ) ;
6
+
7
+ export default {
8
+ props : {
9
+ content : {
10
+ type : String ,
11
+ default : ""
12
+ }
13
+ } ,
14
+
15
+ mounted ( ) {
16
+ const el = this . $refs . nEditor ;
17
+ // const Quill = await require('quill')
18
+ this . quill = new Quill ( el , {
19
+ modules : { toolbar : true } ,
20
+ theme : "snow"
21
+ } ) ;
22
+
23
+ this . handleInitialContent ( ) ;
24
+ this . quill . on ( "text-change" , this . handleTextChange ) ;
25
+ // import('quill').then((module) => {
26
+ // const Quill = module.default
27
+ // const el = this.$refs.nEditor
28
+ // this.quill = new Quill(el, {
29
+ // modules: { toolbar: true },
30
+ // theme: 'snow'
31
+ // })
32
+
33
+ // this.handleInitialContent()
34
+ // this.quill.on('text-change', this.handleTextChange)
35
+ // })
36
+ } ,
37
+
38
+ methods : {
39
+ handleInitialContent ( ) {
40
+ if ( this . content ) this . quill . root . innerHTML = this . content ;
41
+ // if (this.value) this.$refs.qEditor.innerHTML = this.value // Set initial editor content
42
+ }
43
+ } ,
44
+
45
+ render ( ) {
46
+ return (
47
+ < div className = "quillWrapper" >
48
+ < div ref = "nEditor" />
49
+ </ div >
50
+ ) ;
51
+ }
52
+ } ;
Original file line number Diff line number Diff line change
1
+ export default {
2
+ props : {
3
+ message : {
4
+ type : String ,
5
+ default : "Default Message"
6
+ }
7
+ } ,
8
+ render ( ) {
9
+ return < p > hello { this . message } </ p > ;
10
+ }
11
+ } ;
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <h2 >Simple Component</h2 >
4
+ </div >
5
+ </template >
6
+
7
+ <script >
8
+ export default {};
9
+ </script >
10
+
11
+ <style lang="scss" scoped></style >
Original file line number Diff line number Diff line change 15
15
</template >
16
16
17
17
<script >
18
+ // import Quill from 'quill'
18
19
import Vue from " vue" ;
19
20
import defaultToolbar from " @/helpers/default-toolbar" ;
20
21
import oldApi from " @/helpers/old-api" ;
21
22
import mergeDeep from " @/helpers/merge-deep" ;
23
+ // import MarkdownShortcuts from '@/helpers/markdown-shortcuts'
22
24
23
25
let Quill;
24
26
let MarkdownShortcuts;
27
+ // if (!Vue.prototype.$isServer) Quill = require('quill')
25
28
if (! Vue .prototype .$isServer ) {
26
- console .log (" In !Vue.prototype.$isServer" );
27
-
28
29
Quill = require (" quill" );
29
- MarkdownShortcuts = require (" @/helpers/markdown-shortcuts" ).default ;
30
- console .log (" TCL: MarkdownShortcuts" , MarkdownShortcuts);
30
+ MarkdownShortcuts = require (" @/helpers/markdown-shortcuts" );
31
31
}
32
32
33
33
export default {
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-console */
2
2
import VueEditor from "./components/VueEditor.vue" ;
3
+ import VSimple from "./components/VSimple.vue" ;
4
+ import VComp from "./components/VComp.js" ;
5
+ import NEditor from "./components/NEditor.js" ;
6
+ console . log ( "TCL: VComp" , VComp ) ;
7
+ // eslint-disable-next-line no-console
8
+ console . log ( "TCL: VueEditor" , VueEditor ) ;
3
9
4
10
const Plugin = {
5
11
install ( Vue , options = { } ) {
6
- console . log ( "install -> options" , options ) ;
7
12
Vue . component ( "VueEditor" , VueEditor ) ;
13
+ Vue . component ( "VSimple" , VSimple ) ;
14
+ Vue . component ( "VComp" , VComp ) ;
15
+ Vue . component ( "NEditor" , NEditor ) ;
8
16
}
9
17
} ;
10
18
You can’t perform that action at this time.
0 commit comments