vue 中的const {XXX } =this 的作用效果
样例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
您的资助是我最大的动力!
金额随意,欢迎来赏!