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 {
45
45
watch: {
46
46
data: {
47
47
deep: true ,
48
- callback (newData ) {
48
+ handler (newData ) {
49
49
this .$emit (' change' , newData)
50
50
}
51
51
}
Original file line number Diff line number Diff line change @@ -2,9 +2,8 @@ export default {
2
2
name : 'img' ,
3
3
icon : 'fa-code' ,
4
4
title : '插入代码' ,
5
- action ( ) {
6
- const selection = this . editor . getSelection ( )
7
- const request = {
5
+ action : {
6
+ request : {
8
7
title : '插入代码' ,
9
8
type : 'form' ,
10
9
body : [
@@ -56,17 +55,12 @@ export default {
56
55
} ,
57
56
{
58
57
name : 'code' ,
59
- type : 'dialog-codemirror' ,
60
- default : selection
58
+ type : 'dialog-codemirror'
61
59
}
62
60
] ,
63
61
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' ;
68
63
}
69
64
}
70
- this . requestData ( request )
71
65
}
72
66
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ export default {
2
2
methods : {
3
3
toolbarAction ( btn ) {
4
4
if ( typeof btn . action === 'function' ) {
5
- btn . action . call ( this )
5
+ btn . action . callback ( this )
6
6
} else {
7
7
this . toolbarHandleActionLegacy ( btn . action )
8
8
}
Original file line number Diff line number Diff line change @@ -17,8 +17,6 @@ module.exports = {
17
17
libraryExport : 'default'
18
18
}
19
19
} ,
20
- transpileDependencies : [
21
- / m a r k d o w n - i t - v /
22
- ] ,
20
+ transpileDependencies : [ ] ,
23
21
productionSourceMap : false
24
22
}
You can’t perform that action at this time.
0 commit comments