Skip to content

Commit 1a3c236

Browse files
committed
chore: testing
1 parent ae90b46 commit 1a3c236

File tree

6 files changed

+91
-8
lines changed

6 files changed

+91
-8
lines changed

src/App.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<template>
22
<div id="app">
33
<button @click="deleteImage">Delete</button>
4-
<VueEditor
4+
<!-- <VueEditor
55
ref="vEditor"
66
v-model="content"
77
use-custom-image-handler
8-
use-markdown-shortcuts
98
@focus="onEditorFocus"
109
@blur="onEditorBlur"
1110
@imageAdded="handleImageAdded"
1211
@image-removed="handleImageRemoved"
13-
/>
12+
/> -->
13+
14+
<NEditor v-model="content" />
1415
</div>
1516
</template>
1617

src/components/NEditor.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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+
};

src/components/VComp.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
};

src/components/VSimple.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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>

src/components/VueEditor.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@
1515
</template>
1616

1717
<script>
18+
// import Quill from 'quill'
1819
import Vue from "vue";
1920
import defaultToolbar from "@/helpers/default-toolbar";
2021
import oldApi from "@/helpers/old-api";
2122
import mergeDeep from "@/helpers/merge-deep";
23+
// import MarkdownShortcuts from '@/helpers/markdown-shortcuts'
2224
2325
let Quill;
2426
let MarkdownShortcuts;
27+
// if (!Vue.prototype.$isServer) Quill = require('quill')
2528
if (!Vue.prototype.$isServer) {
26-
console.log("In !Vue.prototype.$isServer");
27-
2829
Quill = require("quill");
29-
MarkdownShortcuts = require("@/helpers/markdown-shortcuts").default;
30-
console.log("TCL: MarkdownShortcuts", MarkdownShortcuts);
30+
MarkdownShortcuts = require("@/helpers/markdown-shortcuts");
3131
}
3232
3333
export default {

src/index.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
/* eslint-disable no-console */
22
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);
39

410
const Plugin = {
511
install(Vue, options = {}) {
6-
console.log("install -> options", options);
712
Vue.component("VueEditor", VueEditor);
13+
Vue.component("VSimple", VSimple);
14+
Vue.component("VComp", VComp);
15+
Vue.component("NEditor", NEditor);
816
}
917
};
1018

0 commit comments

Comments
 (0)