1722
社区成员
```c#
async function LoadData() {
await fetch('http://localhost:57679/api/Customers')
.then((response) => response.json())
.then((data) => {
tableData.value = data
})
.catch((err) => {
console.log(JSON.stringify(err))
})
}
async function DeleteRow(id: number) {
let url = `http://localhost:57679/api/Customers/${id}`
await fetch(url, {
method: 'delete'
})
.then((response) => {
if (!response.ok) {
console.log(response)
throw new Error(JSON.stringify(response))
}
})
.then(() => {
console.log('then')
ElMessage.info('删除成功!')
})
.catch((err) => {
console.log('catch')
console.log(err)
ElMessage.error('删除失败')
})
}
```