chore: 修改代码样式

This commit is contained in:
lihao.ylh 2021-07-29 14:24:12 +08:00
parent 9f051c62ed
commit 94b9aa7037
3 changed files with 15 additions and 15 deletions

View File

@ -28,6 +28,6 @@ module.exports = {
'eol-last': 0, 'eol-last': 0,
'react/no-find-dom-node': 0, 'react/no-find-dom-node': 0,
'no-case-declarations': 0, 'no-case-declarations': 0,
'@typescript-eslint/indent': 0, '@typescript-eslint/indent': 0
} }
}; };

View File

@ -321,21 +321,19 @@ export class Designer {
target: activedDoc.rootNode as ParentalNode, target: activedDoc.rootNode as ParentalNode,
}; };
} }
const focusNode = activedDoc.focusNode; const focusNode = activedDoc.focusNode!;
const nodes = activedDoc.selection.getNodes(); const nodes = activedDoc.selection.getNodes();
const refNode = nodes.find(item => focusNode.contains(item)); const refNode = nodes.find(item => focusNode.contains(item));
let target; let target;
let index: number | undefined; let index: number | undefined;
if (!refNode || refNode === focusNode) { if (!refNode || refNode === focusNode) {
target = focusNode; target = focusNode;
} else if (refNode.componentMeta.isContainer) {
target = refNode;
} else { } else {
if (refNode.componentMeta.isContainer) { // FIXME!!, parent maybe null
target = refNode; target = refNode.parent!;
} else { index = refNode.index + 1;
// FIXME!!, parent maybe null
target = refNode.parent!;
index = refNode.index + 1;
}
} }
if (target && insertNode && !target.componentMeta.checkNestingDown(target, insertNode)) { if (target && insertNode && !target.componentMeta.checkNestingDown(target, insertNode)) {

View File

@ -5,7 +5,7 @@ import {
PluginClassSet, PluginClassSet,
KeyType, KeyType,
GetReturnType, GetReturnType,
HookConfig HookConfig,
} from '@ali/lowcode-types'; } from '@ali/lowcode-types';
import { globalLocale } from './intl'; import { globalLocale } from './intl';
import * as utils from './utils'; import * as utils from './utils';
@ -156,13 +156,15 @@ export class Editor extends EventEmitter implements IEditor {
}); });
}; };
/* eslint-disable */
private waits = new Map< private waits = new Map<
KeyType, KeyType,
Array<{ Array<{
once?: boolean; once?: boolean;
resolve: (data: any) => void; resolve: (data: any) => void;
}> }>
>(); >();
/* eslint-enable */
private notifyGot(key: KeyType) { private notifyGot(key: KeyType) {
let waits = this.waits.get(key); let waits = this.waits.get(key);