feat: add options to the getValue api
This commit is contained in:
@@ -17,13 +17,9 @@ Usage:
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const {
|
const {
|
||||||
version: string;
|
version: string
|
||||||
width: number;
|
data: IEditorData
|
||||||
height: number;
|
options: IEditorOption
|
||||||
margins: IMargin;
|
|
||||||
header?: IHeader;
|
|
||||||
watermark?: IWatermark;
|
|
||||||
data: IEditorData;
|
|
||||||
} = instance.command.getValue(options?: IGetValueOption)
|
} = instance.command.getValue(options?: IGetValueOption)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -17,13 +17,9 @@ const value = instance.command.commandName()
|
|||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
const {
|
const {
|
||||||
version: string;
|
version: string
|
||||||
width: number;
|
data: IEditorData
|
||||||
height: number;
|
options: IEditorOption
|
||||||
margins: IMargin;
|
|
||||||
header?: IHeader;
|
|
||||||
watermark?: IWatermark;
|
|
||||||
data: IEditorData;
|
|
||||||
} = instance.command.getValue(options?: IGetValueOption)
|
} = instance.command.getValue(options?: IGetValueOption)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -998,9 +998,6 @@ export class Draw {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getValue(options: IGetValueOption = {}): IEditorResult {
|
public getValue(options: IGetValueOption = {}): IEditorResult {
|
||||||
// 配置
|
|
||||||
const { width, height, margins, watermark } = this.options
|
|
||||||
// 数据
|
|
||||||
const { pageNo } = options
|
const { pageNo } = options
|
||||||
let mainElementList = this.elementList
|
let mainElementList = this.elementList
|
||||||
if (
|
if (
|
||||||
@@ -1019,11 +1016,8 @@ export class Draw {
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
version,
|
version,
|
||||||
width,
|
data,
|
||||||
height,
|
options: deepClone(this.options)
|
||||||
margins,
|
|
||||||
watermark: watermark.data ? watermark : undefined,
|
|
||||||
data
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -91,11 +91,8 @@ export interface IEditorOption {
|
|||||||
|
|
||||||
export interface IEditorResult {
|
export interface IEditorResult {
|
||||||
version: string
|
version: string
|
||||||
width: number
|
|
||||||
height: number
|
|
||||||
margins: IMargin
|
|
||||||
watermark?: IWatermark
|
|
||||||
data: IEditorData
|
data: IEditorData
|
||||||
|
options: IEditorOption
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IEditorHTML {
|
export interface IEditorHTML {
|
||||||
|
|||||||
Reference in New Issue
Block a user