File tree Expand file tree Collapse file tree 7 files changed +200
-20
lines changed Expand file tree Collapse file tree 7 files changed +200
-20
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" example clearfix " >
2
+ <div class =" example" >
3
3
<VueEditor v-model =" content" use-markdown-shortcuts />
4
4
</div >
5
5
</template >
6
6
7
7
<script >
8
- if (typeof process === undefined ) {
8
+ let VueEditor;
9
+ if (typeof window !== " undefined" ) {
9
10
console .log (" GOT WINDOW" );
11
+ console .log (" TCL: window" , window );
12
+
13
+ VueEditor = window .Vue2Editor .VueEditor ;
10
14
}
11
- const VueEditor = Vue2Editor .VueEditor ;
15
+ // const VueEditor = window. Vue2Editor.VueEditor;
12
16
export default {
13
17
components: { VueEditor },
14
18
data () {
15
19
return {
16
- content: " null "
20
+ content: " Starting Content "
17
21
};
18
22
}
19
23
};
Original file line number Diff line number Diff line change @@ -13,15 +13,15 @@ module.exports = {
13
13
{
14
14
src : "https://unpkg.com/quill"
15
15
}
16
- ] ,
16
+ ] ,
17
17
[
18
18
"script" ,
19
19
{
20
20
src : "https://unpkg.com/vue2-editor@alpha"
21
21
}
22
22
]
23
23
] ,
24
- plugins : [ require ( "./plugin.js" ) ] ,
24
+ plugins : [ require ( "./plugin.js" ) , "live" ] ,
25
25
locales : {
26
26
"/" : {
27
27
lang : "en-US" ,
Original file line number Diff line number Diff line change @@ -4,6 +4,23 @@ export default ({
4
4
router, // the router instance for the app
5
5
siteData // site metadata
6
6
} ) => {
7
+ // NOTE: Works in DEV mode
8
+ if ( typeof window !== "undefined" ) {
9
+ console . log ( "FROM ENHANCEAPP - GOT WINDOW" ) ;
10
+ console . log ( "TCFROM ENHANCEAPP - window" , window ) ;
11
+
12
+ Vue . use ( window . Vue2Editor ) ;
13
+ }
14
+ Vue . mixin ( {
15
+ data : ( ) => ( {
16
+ editorContent : "Content From Mixin"
17
+ } ) ,
18
+ mounted ( ) {
19
+ // import('vue2-editor').then(module => {
20
+ // console.log('editor module', module);
21
+ // })
22
+ }
23
+ } ) ;
7
24
// if (window !== undefined) {
8
25
// console.log("FROM ENHANCE: ", Vue2Editor);
9
26
// Vue.use(Vue2Editor);
Original file line number Diff line number Diff line change 3
3
## Basic Example
4
4
5
5
<ClientOnly >
6
- <basic-example />
6
+ <BasicExample />
7
7
</ClientOnly >
8
8
9
+ ``` vue live
10
+ <BasicExample />
11
+ <pre>{{editorContent}}</pre>
12
+ ```
13
+
14
+ ### Testing ` Vue.use `
15
+
16
+ ``` vue live
17
+ <VueEditor v-model="editorContent" />
18
+ <pre>{{editorContent}}</pre>
19
+
20
+ ```
21
+
9
22
<!-- ## Customized Example
10
23
11
24
<customized /> -->
Original file line number Diff line number Diff line change 17
17
"docs" : " npm run docs:serve" ,
18
18
"docs:build" : " vue-cli-service docs --mode build" ,
19
19
"docs:serve" : " vue-cli-service docs --mode serve" ,
20
+ "docs:preview" : " http-server docs/.vuepress/dist" ,
20
21
"postbuild:plugin" : " rm dist/demo.html" ,
21
22
"release" : " standard-version" ,
22
23
"release:alpha" : " standard-version --prerelease alpha" ,
94
95
"eslint-plugin-prettier" : " ^3.1.0" ,
95
96
"eslint-plugin-vue" : " ^5.0.0" ,
96
97
"highlight.js" : " ^9.15.6" ,
98
+ "http-server" : " ^0.11.1" ,
97
99
"node-sass" : " ^4.12.0" ,
98
100
"querystringify" : " ^2.1.1" ,
99
101
"quill-image-drop-module" : " ^1.0.3" ,
104
106
"vue" : " ^2.6.10" ,
105
107
"vue-cli-plugin-vplugin" : " davidroyer/vue-cli-plugin-vplugin" ,
106
108
"vue-router" : " ^3.0.6" ,
107
- "vue-template-compiler" : " ^2.5.21"
109
+ "vue-template-compiler" : " ^2.5.21" ,
110
+ "vuepress-plugin-live" : " ^1.1.0"
108
111
},
109
112
"peerDependencies" : {},
110
113
"eslintIgnore" : [
Original file line number Diff line number Diff line change 5
5
6
6
import Vue from "vue" ;
7
7
import plugin from "./index" ;
8
+ const { Quill, version } = plugin ;
9
+
8
10
console . log ( "TCL: plugin" , plugin ) ;
9
- import { VueEditor , Quill , version } from "./index" ;
10
11
console . log ( "TCL: version" , version ) ;
11
12
console . log ( "TCL: Quill" , Quill ) ;
12
- console . log ( "TCL: VueEditor" , VueEditor ) ;
13
13
14
14
Vue . use ( plugin ) ;
15
15
You can’t perform that action at this time.
0 commit comments