报错提示

报错代码
在有删除功能的提示框中都会有这样的报错:
const confirmResult = await this.$confirm(
'此操作将删除xx, 是否继续?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
).cath(err => err)
解决
const confirmResult = await this.$confirm(
'此操作将删除xx, 是否继续?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}
)
.catch(err => err)
.then(data => data)
添加了 .then 之后就可以了 😂
也不知道为什么
本文介绍了一种在Vue应用中解决删除确认提示框出现报错的方法。通过调整$.confirm方法的处理逻辑,在.catch后添加.then(data=>data),成功解决了报错提示问题。

8266

被折叠的 条评论
为什么被折叠?



