gpt4 book ai didi

javascript - 将重复的查询参数推送到 Vue 路由器

转载 作者:行者123 更新时间:2023-12-02 23:36:56 25 4
gpt4 key购买 nike

我想构造一个像“http://localhost:64549/request/list?page=1&dataLakeStatus=1&dataLakeStatus=2 ”这样的 url 字符串,并在查询参数中包含重复的键。由于 JS 不允许重复键,我该如何使用 Vue 路由器做到这一点?

 private redirectToFirstPage() {
const query = { page: this.currentPage.toString(), dataLakeStatus: '1', dataLakeStatus: '2' };
this.$router.push({ query });
}

最佳答案

尝试以下操作:

private redirectToFirstPage() {
const query = {
page: this.currentPage.toString(),
dataLakeStatus: [1, 2]
};

this.$router.push({ query });
}

关于javascript - 将重复的查询参数推送到 Vue 路由器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56252059/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com