File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed
src/components/toolbar-button Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ export default {
2+ name : 'img' ,
3+ icon : 'fa-code' ,
4+ title : '插入代码' ,
5+ action : {
6+ request : {
7+ title : '插入代码' ,
8+ body : [
9+ {
10+ name : 'lang' ,
11+ title : '语言类型' ,
12+ type : 'input' ,
13+ default : ''
14+ } ,
15+ {
16+ name : 'code' ,
17+ title : '代码' ,
18+ type : 'textarea' ,
19+ default : ''
20+ }
21+ ] ,
22+ callback ( data ) {
23+ return '```' + data . lang + '\n'
24+ + data . code + '\n'
25+ + '```'
26+ }
27+ }
28+ }
29+ }
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import BtnsHeader from './btn-header'
99import BtnUl from './btn-ul'
1010import BtnOl from './btn-ol'
1111import BtnHr from './btn-hr'
12+ import BtnCode from './btn-code'
1213
1314export let defaultBtns = [
1415 BtnBold ,
@@ -28,6 +29,7 @@ export let defaultBtns = [
2829 Divider ,
2930 BtnImg ,
3031 BtnLink ,
32+ BtnCode ,
3133 BtnTable
3234]
3335
You can’t perform that action at this time.
0 commit comments