this.$prompt('请确定是否要关闭某开关', '提示', {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(({ value }) => {
//确定后逻辑接口
}).catch(() => {}) //这一行是解决报错的重点
原因:this.$prompt方法内置promise方法,所以不能把.catch()去掉(因为取消操作时,无法捕获)