feat: add custom field to getValue api #699
This commit is contained in:
@@ -1005,7 +1005,7 @@ export class Draw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getValue(options: IGetValueOption = {}): IEditorResult {
|
public getValue(options: IGetValueOption = {}): IEditorResult {
|
||||||
const { pageNo } = options
|
const { pageNo, extraPickAttrs } = options
|
||||||
let mainElementList = this.elementList
|
let mainElementList = this.elementList
|
||||||
if (
|
if (
|
||||||
Number.isInteger(pageNo) &&
|
Number.isInteger(pageNo) &&
|
||||||
@@ -1017,9 +1017,15 @@ export class Draw {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
const data: IEditorData = {
|
const data: IEditorData = {
|
||||||
header: zipElementList(this.getHeaderElementList()),
|
header: zipElementList(this.getHeaderElementList(), {
|
||||||
main: zipElementList(mainElementList),
|
extraPickAttrs
|
||||||
footer: zipElementList(this.getFooterElementList())
|
}),
|
||||||
|
main: zipElementList(mainElementList, {
|
||||||
|
extraPickAttrs
|
||||||
|
}),
|
||||||
|
footer: zipElementList(this.getFooterElementList(), {
|
||||||
|
extraPickAttrs
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
version,
|
version,
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ export interface IPainterOption {
|
|||||||
|
|
||||||
export interface IGetValueOption {
|
export interface IGetValueOption {
|
||||||
pageNo?: number
|
pageNo?: number
|
||||||
|
extraPickAttrs?: Array<keyof IElement>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IAppendElementListOption {
|
export interface IAppendElementListOption {
|
||||||
|
|||||||
Reference in New Issue
Block a user