我正在使用无限滚动。为此,我需要使用history.pushState方法。但是,当我推送任何新状态时,它将我的参数连接某种类型的无用字符串。
let stateCounter = history.state ? window.history.state + 1 : matches ? parseInt(matches[1]) + 1 : 1;
history.pushState(stateCounter, "", ${homeUrl}/experiences/${city}/?page=${stateCounter});
地址栏上的输出:
local/experiences/barcelona/?page=1&customize_changeset_uuid=
字符串“ customize_changeset_uuid =”不再需要。