* 方法:动态设置属性值
(
newOptions: Partial<
Pick<Options, ComplexOptions | PlainOptions | PlainOptionsWL>
>
)
| 271 | * 方法:动态设置属性值 |
| 272 | */ |
| 273 | setOptions( |
| 274 | newOptions: Partial< |
| 275 | Pick<Options, ComplexOptions | PlainOptions | PlainOptionsWL> |
| 276 | > |
| 277 | ): void { |
| 278 | if (!this.isRunningSupported || !isPlainObject(newOptions)) return |
| 279 | |
| 280 | // 调用 Wave 更新项 |
| 281 | super.setOptions(newOptions) |
| 282 | |
| 283 | for (const property in newOptions) { |
| 284 | if ( |
| 285 | Object.hasOwnProperty.call(newOptions, property) && |
| 286 | plainOptionsWL.indexOf(property as never) !== -1 |
| 287 | ) { |
| 288 | const newValue = newOptions[property as PlainOptionsWL] |
| 289 | this.options[property as PlainOptionsWL] = newValue as never |
| 290 | if (property === 'borderRadius') { |
| 291 | this.setCanvasStyle() |
| 292 | } |
| 293 | } |
| 294 | } |
| 295 | } |
| 296 | |
| 297 | /** |
| 298 | * 方法:让进度立即加载完成 |
nothing calls this directly
no test coverage detected