js

JS笔记

2019-04-24

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

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)
    })
Read more