File tree Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Expand file tree Collapse file tree 4 files changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default {
4545 watch: {
4646 data: {
4747 deep: true ,
48- callback (newData ) {
48+ handler (newData ) {
4949 this .$emit (' change' , newData)
5050 }
5151 }
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ export default {
22 name : 'img' ,
33 icon : 'fa-code' ,
44 title : '插入代码' ,
5- action ( ) {
6- const selection = this . editor . getSelection ( )
7- const request = {
5+ action : {
6+ request : {
87 title : '插入代码' ,
98 type : 'form' ,
109 body : [
@@ -56,17 +55,12 @@ export default {
5655 } ,
5756 {
5857 name : 'code' ,
59- type : 'dialog-codemirror' ,
60- default : selection
58+ type : 'dialog-codemirror'
6159 }
6260 ] ,
6361 callback : ( data ) => {
64- this . editor . replaceSelection ( '```' + data . lang + '\n' +
65- data . code + '\n' +
66- '```\n' )
67- this . editor . focus ( )
62+ return '```' + data . lang + '\n' + data . code + '\n' + '```\n' ;
6863 }
6964 }
70- this . requestData ( request )
7165 }
7266}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ export default {
22 methods : {
33 toolbarAction ( btn ) {
44 if ( typeof btn . action === 'function' ) {
5- btn . action . call ( this )
5+ btn . action . callback ( this )
66 } else {
77 this . toolbarHandleActionLegacy ( btn . action )
88 }
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ module.exports = {
1717 libraryExport : 'default'
1818 }
1919 } ,
20- transpileDependencies : [
21- / m a r k d o w n - i t - v /
22- ] ,
20+ transpileDependencies : [ ] ,
2321 productionSourceMap : false
2422}
You can’t perform that action at this time.
0 commit comments