mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-23 10:39:53 +08:00
完全替换MonocoEditor组件为CodeEditor组件
This commit is contained in:
@@ -372,6 +372,7 @@ export default defineComponent({
|
||||
editor.updateOptions({ wordWrap: revWordWrap });
|
||||
});
|
||||
},
|
||||
// 替换选中的文本,供外部调用
|
||||
repacleEditorSelection(text) {
|
||||
var selection = editor.getSelection();
|
||||
var range = new monaco.Range(
|
||||
@@ -389,6 +390,10 @@ export default defineComponent({
|
||||
};
|
||||
editor.executeEdits("my-source", [op]);
|
||||
},
|
||||
// 格式化文档,供外部调用
|
||||
formatDocument() {
|
||||
editor.getAction("editor.action.formatDocument").run();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
showPlaceholder() {
|
||||
|
||||
Reference in New Issue
Block a user