vue element admin 遇到的问题

572 阅读1分钟

添加员工 修改员工

const isEdit = this.dialogType === 'edit' if (isEdit) { // 此处是修改员工信息 console.log('1') } else { // 此处是新建员工 if (this.role.name === '' || this.role.name === null) { this.$message({ message: '请填写姓名以及电话', type: 'warning' }) } } },

// then()方法是异步执行 意思是:就是当.then()前的方法执行完后再执行then()内部的程序,这样就避免了,数据没获取到等的问题。

.catch(err => { console.error(err) }) promise抛出一个错误,就被catch方法指定的回调函数捕获。

ES2015(ES6) 新增加了两个重要的 JavaScript 关键字: let 和 const。

let 声明的变量只在 let 命令所在的代码块内有效。

const 声明一个只读的常量,一旦声明,常量的值就不能改变。