Skip to content

Commit db1f32b

Browse files
committed
chore(testing): fix
1 parent 8bd0497 commit db1f32b

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue2-editor",
3-
"version": "2.10.1-next.3",
3+
"version": "2.10.1-next.4",
44
"description": "HTML editor using Vue.js 2, and Quill.js, an open source editor",
55
"author": {
66
"name": "David Royer",

src/index.js

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,34 @@
1-
/* eslint-disable no-console */
2-
import VueEditor from "./components/VueEditor";
1+
// import Quill from "quill";
2+
import VueEditor from "@/components/VueEditor.vue";
33

4-
const Plugin = {
5-
install(Vue, options = {}) {
6-
Vue.component("VueEditor", VueEditor);
4+
const version = "__VERSION__";
75

8-
// Vue.prototype.$modal = {
9-
// show(name) {
10-
// location.hash = name
11-
// },
6+
// Declare install function executed by Vue.use()
7+
export function install(Vue) {
8+
if (install.installed) return;
9+
install.installed = true;
1210

13-
// hide(name) {
14-
// location.hash = '#'
15-
// }
16-
// }
17-
}
11+
Vue.component("VueEditor", VueEditor);
12+
}
13+
14+
const VPlugin = {
15+
install,
16+
version,
17+
VueEditor
1818
};
1919

20-
export default Plugin;
20+
// Auto-install when vue is found (eg. in browser via <script> tag)
21+
let GlobalVue = null;
22+
if (typeof window !== "undefined") {
23+
GlobalVue = window.Vue;
24+
} else if (typeof global !== "undefined") {
25+
GlobalVue = global.Vue;
26+
}
27+
if (GlobalVue) {
28+
GlobalVue.use(VPlugin);
29+
}
30+
31+
export default VPlugin;
32+
export { VueEditor };
33+
34+
/*************************************************/

0 commit comments

Comments
 (0)