Files
ClassContent/历届学生/吴欣阳/项目开发/练习项目/课程练习/6.22/修改/demo.html
2024-09-27 02:06:13 +08:00

35 lines
954 B
HTML
Raw 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', // 关闭前确认iconcancel confirm
confirmEvent: () => {
console.log("确定按钮被点击");
},
cancelEvent: () => {
console.log("你点击了取消按钮");
},
})
}
</script>
</html>