picgo/view/user.html
2024-08-01 20:40:06 +08:00

47 lines
1.2 KiB
HTML

{{define "style"}}
{{end}}
{{define "content"}}
<div id="user-inquire">
<div class="alert alert-primary form-inline" role="alert">
<button type="button" id="add-domain" class="btn btn-primary" data-toggle="modal" data-target="#DomainModal"><i class="bi bi-plus-lg"></i> 添加域名</button>
</div>
</div>
<div id="user-table"></div>
{{end}}
{{define "script"}}
<script src="/static/js/table.js"></script>
<script>
$(document).ready(function() {
// 示例数据
let columns = ['ID', '名称', '年龄'];
let data = [
[1, '张三', 25],
[2, '李四', 30],
[3, '王五', 28]
];
// 操作按钮配置
let actions = [
{
label: '编辑',
class: 'primary',
onClick: function(row) {
alert('编辑:' + row[1]);
}
},
{
label: '删除',
class: 'danger',
onClick: function(row) {
alert('删除:' + row[1]);
}
}
];
let table = new Table(columns, data, actions, "#user-table")
table.RenderTable()
})
</script>
{{end}}