confirm:

app.js:98539 Uncaught (in promise) 
TypeError: _this10.$confirm(...).then(...

 

这是因为你点击了取消或者是关闭弹窗,但是你没有写catch。正确的写法是

 

this.$confirm('确定清空试题篮所有试题?', '提示', {
                    type: 'warning'
                }).then(() => {
                      localStorage.setItem('chosedResourceids',"");
                      localStorage.setItem('PaperMsg',"");
                      if( sessionStorage.getItem('PaperMsg')==''){
                          this.$message({
                            message: '操作成功',
                            type: 'success'
                        });
                        this.$router.push({name:'资源中心',query:{kind:40}})
                      }
                }).catch(() => {
                });  //一定别忘了这个

 

 

 

el-date-picker :禁用 

picker-options="expireTimeOption"

 

 

 

expireTimeOption: {
  disabledDate(date) {
    //disabledDate 文档上:设置禁用状态,参数为当前日期,要求返回 Boolean
    return date.getTime() < Date.now() - 24 * 60 * 60 * 1000;
  }
},

 

 

const studentIds = this.studentList.map(
          item => item.studentId
        )

 

 

数组处理:

const arr= [4, 9, 16, 25];
const arr1 = arr.map(item => item+2)
console.log(arr)   // [4, 9, 16, 25]
console.log(arr1)  // [6, 11, 18, 27]