我的模板底部有一个脚本:
_checkInput: function(event) {
let params;
params = null;
params = {
start: this.start,
end: this.end,
title: this.title
};
if (params === null) {
alert("Input is required.")
} else {
this.$.splitter.params = params;
var path = window.location.href;
console.log(path);
path = path.substring(0, path.lastIndexOf('/'))
console.log('Redirecting to: ' + path);
this.$.splitter.execute().then(this.set("route.path", path));
}
},
我想在这里做的是弄清楚路径,然后做一个window.location到该路径的等价物,我读过的是设置route.path。路径是正确的,我已经确认了,但似乎没有this.set(“route.path”没有生效,因为窗口位置保持不变。有没有正确的方法来做到这一点?
谢谢!