feat:set control cursor

This commit is contained in:
Hufe921
2022-04-02 20:26:53 +08:00
10 changed files with 120 additions and 15 deletions
+5 -5
View File
@@ -75,9 +75,9 @@ export function formatElementList(elementList: IElement[], options: IFormatEleme
// 移除父节点
elementList.splice(i, 1)
// 前后缀个性化设置
const thePreSuffixArgs: Pick<IElement, 'color'> = {}
const thePrePostfixArgs: Pick<IElement, 'color'> = {}
if (editorOptions && editorOptions.control) {
thePreSuffixArgs.color = editorOptions.control.bracketColor
thePrePostfixArgs.color = editorOptions.control.bracketColor
}
// 前缀
if (prefix) {
@@ -89,8 +89,8 @@ export function formatElementList(elementList: IElement[], options: IFormatEleme
value,
type: el.type,
control: el.control,
controlComponent: ControlComponent.SUFFIX,
...thePreSuffixArgs
controlComponent: ControlComponent.PREFIX,
...thePrePostfixArgs
})
i++
}
@@ -143,7 +143,7 @@ export function formatElementList(elementList: IElement[], options: IFormatEleme
type: el.type,
control: el.control,
controlComponent: ControlComponent.POSTFIX,
...thePreSuffixArgs
...thePrePostfixArgs
})
i++
}
+1 -1
View File
@@ -19,7 +19,7 @@ export function deepClone<T>(obj: T): T {
if (Array.isArray(obj)) {
newObj = obj.map(item => deepClone(item))
} else {
Object.keys(obj).forEach((key) => {
Object.keys(obj as any).forEach((key) => {
// @ts-ignore
return newObj[key] = deepClone(obj[key])
})