mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
ui: change default editor mode to sv
This commit is contained in:
1 parent
e80e8815cb
commit
f4dbce5a76
4 files changed
+20
-8
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import Notification from 'vj/components/notification';
|
||||
import DOMAttachedObject from 'vj/components/DOMAttachedObject';
|
||||
|
||||
export const config = {
|
||||
@@ -168,7 +169,16 @@ export default class Editor extends DOMAttachedObject {
|
||||
this.vditor = new Vditor(ele, {
|
||||
...config,
|
||||
...this.options,
|
||||
after: () => resolve(null),
|
||||
after: () => {
|
||||
const pos = $(ele).find('button[data-mode="sv"]').get();
|
||||
const button = $('<button data-mode="monaco">Monaco Editor</button>');
|
||||
button.on('click', (e) => {
|
||||
Notification.info('You can select this in PreferenceSettings');
|
||||
e.preventDefault();
|
||||
});
|
||||
button.insertAfter(pos);
|
||||
resolve(null);
|
||||
},
|
||||
input(v) {
|
||||
$dom.val(v);
|
||||
$dom.text(v);
|
||||
|
||||
Reference in new issue
Block a user