Avue upload-delete uploadDelete(file, column) Cannot read properties of undefined (reading ‘then‘)

黎承颜
2023-12-01

Avue 设置upload-delete uploadDelete(file, column) 后报 Cannot read properties of undefined (reading ‘then’)的解决方案

TypeError: Cannot read properties of undefined (reading 'then')
    at a.handleRemove (avue.min.js?80d3:9:1)
    at click (avue.min.js?80d3:9:1)
    at He (vue.min.js:6:11384)
    at HTMLElement.n (vue.min.js:6:13168)
    at Yr.o._wrapper (vue.min.js:6:48505)

解决方法

uploadDelete中必须返回一个Promise类型的值

uploadDelete(file, column) {
  var promiseTest = new Promise((resolve, reject) => {
    this.$message.error("禁止删除");
    // resolve("[这是返回值]");
  });
  return promiseTest;
},
 类似资料: