美文网首页
form get 请求 url拼接参数

form get 请求 url拼接参数

作者: Rose_yang | 来源:发表于2019-11-07 10:12 被阅读0次
  download () {
      let params = {
        qq: this.cacheFormData.qq,
        ww: this.cacheFormData.ww,
        ee: this.cacheFormData.ee,
        rr: this.cacheFormData.rr,
        tt: this.cacheFormData.tt
      }
      let arr = []
      Object.keys(params).forEach(key => {
        if (params[key]) {
          arr.push(key + '=' + params[key])
        }
      })
      let str = '?' + arr.join('&')
      window.location.href = apiUrl + str
    }

相关文章

网友评论

      本文标题:form get 请求 url拼接参数

      本文链接:https://www.haomeiwen.com/subject/koumbctx.html