Files
2024-09-27 02:06:13 +08:00

35 lines
954 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>弹窗插件封装</title>
</head>
<body>
<button onclick="showDialog()">点我</button>
</body>
<script src="./dialog.js"></script>
<script>
function showDialog() {
new Dialog({
title: '测试标题',
content: '这是测试内容',
cancelText: '关闭',
confirmText: '确认',
showClose: false, // true 显示,false关闭
beforeCloseType: 'confirm', // 关闭前确认,icon,cancel, confirm
confirmEvent: () => {
console.log("确定按钮被点击");
},
cancelEvent: () => {
console.log("你点击了取消按钮");
},
})
}
</script>
</html>