gpt4 book ai didi

How to combine Query Parameters in nextjs 13.4(如何在nextjs 13.4中组合查询参数)

转载 作者:bug小助手 更新时间:2023-10-24 17:55:10 29 4
gpt4 key购买 nike



const variantAction = (index: any, colorDef?: any) => {
const safeIndex = index && index > -1 ? index : 0
let colorIndex: number
if (colorDef) {
colorIndex = productDetail?.variants?.[safeIndex]?.colors.findIndex(
(color: any) => color?.name === colorDef
)
} else {
colorIndex = productDetail?.variants?.[safeIndex]?.colors.findIndex(
(color: any) => color?.name === productDetail?.variants?.[safeIndex]?.defaultColor
)
}
colorIndex = colorIndex && colorIndex > -1 ? colorIndex : 0

setCurrentVariant(safeIndex)
setImages(ImageMaker(productDetail?.variants?.[safeIndex]?.colors?.[colorIndex]))
setSelectedColor(productDetail?.variants?.[safeIndex]?.colors?.[colorIndex]?.['@id'])
setColors(productDetail?.variants?.[safeIndex]?.colors)
setColorName(productDetail?.variants?.[safeIndex]?.colors?.[colorIndex]?.name)
setSizes(productDetail?.variants?.[safeIndex]?.colors?.[colorIndex]?.sizes)
setPersonalizationTexts(null)
setError(false)
checkWishlist(safeIndex)
const s = productDetail?.variants?.[safeIndex]?.productId
const c = productDetail?.variants?.[safeIndex]?.colors?.[colorIndex]?.name

router.replace(`${pathname}?${createQueryString('c', c)}`)
router.replace(`${pathname}?${createQueryString('s', s)}`)
}

http://localhost:3000/campaign/33?xs=rw&s=gildan-18500
in above url i am able to see only router.replace(${pathname}?${createQueryString('s', s)}) but i want to combin both route.replace statements and i want to show both in url

以上URL中的http://localhost:3000/campaign/33?xs=rw&s=gildan-18500我只能看到router.replace(${pathname}?${createQueryString(‘s’,S)})但我想合并两个路径。替换语句,我想在URL中显示这两个语句


更多回答

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

请澄清您的具体问题或提供更多详细信息,以突出您的确切需求。按照目前的写法,很难准确地说出你在问什么。

优秀答案推荐
更多回答

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