JS笔记

js中要用变量作为key的话使用方括号括住
例:this.searchKeyword

1
2
3
4
5
6
this.$http({
url: this.searchUrl,
method: this.remoteRequestMethod,
params: Object.assign({}, this.searchParams, this.pager),
data: Object.assign({ [this.searchKeyword]: query }, this.searchBody, this.pager)
})

全文完🙈