{{/*
dialog.html — 通用对话框公共组件
对标 React 版 Dialog.tsx,提供确认 / 提示两种对话框。
提供两个子模板:
hp-dialog-html → 放在页面 body 末尾(HTML 结构)
hp-dialog-js → 紧跟其后(JS API)
快捷模板(推荐,一行搞定):
hp-dialog → 同时输出 html + js
JS API:
hpConfirm({
title: '标题',
message: '内容',
type: 'danger', // default | danger | warning | success
confirmText: '确定', // 可选,默认"确定"
cancelText: '取消', // 可选,默认"取消"
onConfirm: function(){ ... } // 确认回调
})
hpAlert({
title: '标题',
message: '内容',
type: 'error', // default | error | warning | success | info
buttonText: '知道了', // 可选
onClose: function(){ ... } // 可选
})
hpCloseDialog() // 手动关闭
使用示例(任意页面