Bind click-to-popup via xjs('.btn').layer(options), or via data-layer-* attributes.
// 1) Bind with explicit options
xjs('.btn-delete').layer({
title: 'Delete item?',
text: 'This action cannot be undone.',
icon: 'warning',
showCancelButton: true
});
// 2) Bind from data-* (no JS options needed)
xjs('.btn-data').layer();
<button class="btn danger btn-delete">Delete (bind .layer)</button> <button class="btn btn-data" data-layer-title="Data-driven popup" data-layer-text="Configured via data-layer-* attributes" data-layer-icon="success" data-layer-cancel="true" >Open (data-layer-*)</button>
/* Local styles for buttons only */
Selection.layer() 的去重绑定与 dataset 解析(data-layer-title/text/icon/cancel)。