vue 中的const {XXX } =this 的作用效果
样例1:const { xxx } = this.state;上面的写法是es6的写法,其实就相当于:const xxx = this.state.xxx样例2:const {comment,index,deleteComment} = this上面的这句话是一个简写,最终的含义相当于constcomment = this.commentconstindex = this.indexconstde
·
样例1:
const { xxx } = this.state;
上面的写法是es6的写法,其实就相当于:
const xxx = this.state.xxx
样例2:
const {comment,index,deleteComment} = this
上面的这句话是一个简写,最终的含义相当于
const comment = this.comment
const index = this.index
const deleteComment = this.deleteComment
更多推荐



所有评论(0)