File tree 6 files changed +18
-27
lines changed
6 files changed +18
-27
lines changed Original file line number Diff line number Diff line change 13
13
"axios" : " ^0.15.3" ,
14
14
"babel-polyfill" : " ^6.23.0" ,
15
15
"element-ui" : " 2.3.3" ,
16
+ "mavon-editor" : " ^2.5.2" ,
16
17
"vue" : " ^2.5.16" ,
17
18
"vue-core-image-upload" : " 2.1.11" ,
18
19
"vue-datasource" : " 1.0.12" ,
Original file line number Diff line number Diff line change 36
36
title: ' 自述文件'
37
37
},
38
38
{
39
- icon: ' el-icon-menu ' ,
39
+ icon: ' el-icon-tickets ' ,
40
40
index: ' 2' ,
41
41
title: ' 常用表格' ,
42
42
subs: [
97
97
}
98
98
},
99
99
created (){
100
+ // 通过 Event Bus 进行组件间通信,来折叠侧边栏
100
101
bus .$on (' collapse' , msg => {
101
102
this .collapse = msg;
102
103
})
Original file line number Diff line number Diff line change 2
2
<div class =" table" >
3
3
<div class =" crumbs" >
4
4
<el-breadcrumb separator =" /" >
5
- <el-breadcrumb-item ><i class =" el-icon-menu " ></i > 表格</el-breadcrumb-item >
5
+ <el-breadcrumb-item ><i class =" el-icon-tickets " ></i > 表格</el-breadcrumb-item >
6
6
<el-breadcrumb-item >基础表格</el-breadcrumb-item >
7
7
</el-breadcrumb >
8
8
</div >
Original file line number Diff line number Diff line change 8
8
</div >
9
9
<div class =" container" >
10
10
<div class =" plugins-tips" >
11
- Vue-SimpleMDE:Vue.js的Markdown Editor组件。
12
- 访问地址:<a href =" https://github.com/F-loat/vue-simplemde" target =" _blank" >Vue-SimpleMDE</a >
13
- </div >
14
- <markdown-editor v-model =" content" :configs =" configs" ref =" markdownEditor" ></markdown-editor >
15
- <div class =" plugins-tips" >
16
- <p >既然用了markdown语法了,那么就有一个很实际的问题了。要怎么在前台展示数据呢?</p >
17
- <br >
18
- <p >这个时候就需要解析markdown语法了。可以使用 <a href =" https://github.com/miaolz123/vue-markdown" target =" _blank" >vue-markdown</a >:一个基于vue.js的markdown语法解析插件。(这里不作展开,有需要自行了解)</p >
11
+ mavonEditor:基于Vue的markdown编辑器。
12
+ 访问地址:<a href =" https://github.com/hinesboy/mavonEditor" target =" _blank" >mavonEditor</a >
19
13
</div >
14
+ <mavon-editor v-model =" content" codeStyle =" tomorrow-night-blue" style =" min-height : 600px " />
15
+
20
16
</div >
21
17
</div >
22
18
</template >
23
19
24
20
<script >
25
- import { markdownEditor } from ' vue-simplemde' ;
21
+ import { mavonEditor } from ' mavon-editor'
22
+ import ' mavon-editor/dist/css/index.css'
26
23
export default {
27
24
data : function (){
28
25
return {
29
26
content: ' ' ,
30
27
configs: {
31
- status: true ,
32
- initialValue: ' Hello BBK' ,
33
- renderingConfig: {
34
- codeSyntaxHighlighting: true ,
35
- highlightingTheme: ' atom-one-light'
36
- }
37
28
}
38
29
}
39
30
},
40
31
components: {
41
- markdownEditor
32
+ mavonEditor
42
33
}
43
34
}
44
35
</script >
Original file line number Diff line number Diff line change 11
11
Vue-Quill-Editor:基于Quill、适用于Vue2的富文本编辑器。
12
12
访问地址:<a href =" https://github.com/surmon-china/vue-quill-editor" target =" _blank" >vue-quill-editor</a >
13
13
</div >
14
- <quill-editor ref =" myTextEditor" v-model =" content" :config =" editorOption" ></quill-editor >
14
+ <quill-editor ref =" myTextEditor" v-model =" content" :options =" editorOption" ></quill-editor >
15
15
<el-button class =" editor-btn" type =" primary" @click =" submit" >提交</el-button >
16
16
</div >
17
17
</div >
18
18
</template >
19
19
20
20
<script >
21
+ import ' quill/dist/quill.core.css' ;
22
+ import ' quill/dist/quill.snow.css' ;
23
+ import ' quill/dist/quill.bubble.css' ;
21
24
import { quillEditor } from ' vue-quill-editor' ;
22
25
export default {
23
26
data : function (){
24
27
return {
25
- content: ' <p>Hello BBK</p> ' ,
28
+ content: ' ' ,
26
29
editorOption: {
27
- // something config
30
+ placeholder : ' Hello World '
28
31
}
29
32
}
30
33
},
39
42
console .log (this .content );
40
43
this .$message .success (' 提交成功!' );
41
44
}
42
- },
43
- computed: {
44
- editor () {
45
- return this .$refs .myTextEditor .quillEditor ;
46
- }
47
45
}
48
46
}
49
47
</script >
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ export default new Router({
38
38
{
39
39
// markdown组件
40
40
path : '/markdown' ,
41
- component : resolve => require ( [ '../components/page/VueEditor .vue' ] , resolve )
41
+ component : resolve => require ( [ '../components/page/Markdown .vue' ] , resolve )
42
42
} ,
43
43
{
44
44
// Vue-Core-Image-Upload组件
You can’t perform that action at this time.
0 commit comments