feat:add watermark

This commit is contained in:
黄云飞
2022-01-18 11:54:35 +08:00
parent dd5cc4ce01
commit 1b1845f9c6
6 changed files with 63 additions and 1 deletions
+11 -1
View File
@@ -16,6 +16,7 @@ import { IContextMenuContext, IRegisterContextMenu } from './interface/contextme
import { EditorComponent } from './dataset/enum/Editor'
import { EDITOR_COMPONENT } from './dataset/constant/Editor'
import { IHeader } from './interface/Header'
import { IWatermark } from './interface/Watermark'
export default class Editor {
@@ -31,6 +32,14 @@ export default class Editor {
font: 'Yahei',
...options.header
}
const waterMarkOptions: Required<IWatermark> = {
data: '',
color: '#AEB5C0',
opacity: 0.3,
size: 200,
font: 'Yahei',
...options.watermark
}
const editorOptions: Required<IEditorOption> = {
defaultType: 'TEXT',
defaultFont: 'Yahei',
@@ -62,7 +71,8 @@ export default class Editor {
defaultHyperlinkColor: '#0000FF',
headerTop: 50,
...options,
header: headerOptions
header: headerOptions,
watermark: waterMarkOptions
}
formatElementList(elementList)
// 监听