let books = res.data.data
books.map((item, index) => {
document.querySelector('.list').innerHTML += `
<tr>
<td>${index + 1}</td>
<td>${item.bookname}</td>
<td>${item.author}</td>
<td>${item.publisher}</td>
<td data-id="${item.id}">
<span class="del">删除</span>
<span class="edit">编辑</span>
</td>
</tr>
`
})
循环向HTML中插入内容
于 2024-05-07 17:35:41 首次发布