Skip to content

Commit 2bf8b68

Browse files
committed
Fix bugs
1 parent 8cf4d18 commit 2bf8b68

File tree

4 files changed

+7
-15
lines changed

4 files changed

+7
-15
lines changed

src/components/Dialog/DialogForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

src/components/ToolBarBtns/btn-code.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff 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
}

src/mixins/ToolbarMixin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

vue.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ module.exports = {
1717
libraryExport: 'default'
1818
}
1919
},
20-
transpileDependencies: [
21-
/markdown-it-v/
22-
],
20+
transpileDependencies: [],
2321
productionSourceMap: false
2422
}

0 commit comments

Comments
 (0)