需求:点击编辑后,弹出来的编辑表单ID不回显
改动点:
works.html JS
// 新增提交的方法(删除逻辑)
const del_works_api = async (id) => {
const options = {
method: ‘DELETE’,
headers: {‘Content-Type’: ‘application/json’},
}
const response = await fetch(/api/del_works/${id}
, options)
return await response.json()
}
table.on('tool(currentTableFilter)', function (obj) {
//table_user为表格的lay-filter的值
//获取当前操作的tr的相关数据
var data = obj.data;
console.log(data)
//判断事件名,做出不同的操作
if (obj.event === 'edit') {
var index = layer.open({
title: '编辑著作信息',