feat:copy and paste highlight element

This commit is contained in:
Hufe921
2023-03-05 15:45:29 +08:00
parent 17b469be6b
commit 0493ae2d5e
+6
View File
@@ -118,6 +118,9 @@ export function writeElementList(elementList: IElement[], options: DeepRequired<
if (element.size) {
dom.style.fontSize = `${element.size}px`
}
if (element.highlight) {
dom.style.backgroundColor = element.highlight
}
clipboardDom.append(dom)
}
}
@@ -156,6 +159,9 @@ export function getElementListByHTML(htmlText: string, options: IGetElementListB
if (rowFlex !== RowFlex.LEFT) {
element.rowFlex = rowFlex
}
if (style.backgroundColor !== 'rgba(0, 0, 0, 0)') {
element.highlight = style.backgroundColor
}
elementList.push(element)
}
} else if (dom.nodeType === 1) {