MCPcopy Create free account
hub / github.com/Barrior/JParticles / setOptions

Method setOptions

src/wave-loading.ts:273–295  ·  view source on GitHub ↗

* 方法:动态设置属性值

(
    newOptions: Partial<
      Pick<Options, ComplexOptions | PlainOptions | PlainOptionsWL>
    >
  )

Source from the content-addressed store, hash-verified

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 * 方法:让进度立即加载完成

Callers

nothing calls this directly

Calls 2

setCanvasStyleMethod · 0.95
isPlainObjectFunction · 0.90

Tested by

no test coverage detected