UI › LAYER
STATIC API

Static API / Builder API

Layer supports Layer.fire() and Layer.$(...).fire() (builder style), and returns a Promise result.

Examples
JavaScript
HTML
CSS
// 1) Static fire
Layer.fire({ title: 'Hello', text: 'Layer.fire(...)', icon: 'info' });

// 2) Builder style
Layer.$()
  .config({ title: 'Confirm?', icon: 'warning', showCancelButton: true })
  .fire()
  .then((res) => console.log(res));
<button class="btn primary">Layer.fire()</button>
<button class="btn">Layer.$().config().fire()</button>
/* Local styles for buttons only */
功能说明:验证 Layer 自身的静态入口(不依赖 Selection.layer 绑定),以及 builder 模式的链式配置。
Promise result is printed to console.
Previous
Next