收藏
回答

URL中引用变量值得问题?

${this.data.query.id}格式写错了吗?

shopList数组中的数据为0,直接用 url: 'https://www.escook.cn/categories/1/shops'可以得到数据。


回答关注问题邀请回答
收藏

2 个回答

  • Mr.Zhao
    Mr.Zhao
    2022-03-18

    反引号,写错了

    2022-03-18
    有用 1
    回复 3
    • 多明亮
      多明亮
      2022-03-18
      不明白
      2022-03-18
      回复
    • Mr.Zhao
      Mr.Zhao
      2022-03-18回复多明亮
      2022-03-18
      1
      回复
    • 多明亮
      多明亮
      2022-03-18
      多谢
      2022-03-18
      回复
  • 拾柒
    拾柒
    2022-03-18

    `https://xxxxx/${this.data.query.id}/shops`

    2022-03-18
    有用 1
    回复 5
    • 多明亮
      多明亮
      2022-03-18
      不明白
      2022-03-18
      回复
    • 拾柒
      拾柒
      2022-03-18回复多明亮
      反引号,键盘Esc健下面那个
      2022-03-18
      回复
    • 雨季,莫忧离
      雨季,莫忧离
      2022-09-04
      z知道是哪个,把$换了?
      2022-09-04
      回复
    • 雨季,莫忧离
      雨季,莫忧离
      2022-09-04
      `{this.data.query.id}/????
      2022-09-04
      回复
    • 雨季,莫忧离
      雨季,莫忧离
      2022-09-04
      `https://www/${this.data.query.id}/shops` 把外边的引号换位反引号,实在不行复制本人的这个
      2022-09-04
      回复
登录 后发表内容