feat:增加图片插入

This commit is contained in:
黄云飞
2021-11-20 18:04:41 +08:00
parent b4553560af
commit 4160abfac8
24 changed files with 238 additions and 62 deletions
+8
View File
@@ -1,6 +1,14 @@
import { ElementType, IElement } from ".."
import { ZERO } from "../dataset/constant/Common"
export function writeText(text: string) {
if (!text) return
window.navigator.clipboard.writeText(text.replaceAll(ZERO, `\n`))
}
export function writeTextByElementList(elementList: IElement[]) {
const text = elementList
.map(p => !p.type || p.type === ElementType.TEXT ? p.value : '')
.join('')
writeText(text)
}