ui: fix #74 (multi-lang edit for problem)

This commit is contained in:
undefined committed 2021-04-26 22:00:15 +08:00
1 parent ef5ee468bd
commit ebaa3f290b
10 files changed
+117 -85

No files matched your search

@@ -40,12 +40,17 @@ export default class CmEditor extends DOMAttachedObject {
const origin = $dom.get(0);
const ele = document.createElement('div');
const value = $dom.val();
const onChange = this.options.onChange;
await new Promise((resolve) => {
this.editor = new Vditor(ele, {
...config,
...this.options,
after: resolve,
input(v) { $dom.val(v); $dom.text(v); },
input(v) {
$dom.val(v);
$dom.text(v);
if (onChange) onChange(v);
},
value,
cache: { id: Math.random().toString() },
});
+2 -6
View File
@@ -28,12 +28,8 @@ export default class Tab extends DOMAttachedObject {
}
async switchToTab(idx) {
if (idx === this.currentIndex) {
return;
}
if (this.isAnimating) {
return;
}
if (idx === this.currentIndex) return;
if (this.isAnimating) return;
const $tabs = this.$content.children();
const $currentTab = $tabs.eq(this.currentIndex);