Dialog 对话框
里面的下划线不识别:methods: { handleClose(done) { this.$confirm('确认关闭?') .then(\_ => { done(); }) .catch(\_ => {}); } }
把下划线改成括号()就正常了
`methods: {
handleClose(done) {
this.$confirm('确认关闭?')
.then(() => {
done();
})
.catch(() => {});
}
}`
https://element.eleme.cn/#/zh-CN/component/dialog#attributes
_
只是个变量名罢了,JS 的变量名是可以以_
或$
开头的。倒是你粘贴的为啥前面多了个反斜杠?这个肯定不认呐。