picgo/view/user.html

43 lines
1012 B
HTML
Raw Normal View History

{{define "style"}}
{{end}}
{{define "content"}}
<div id="user-inquire"></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.Generic()
})
</script>
{{end}}