1

我想使用 javascript 和 typescript 进行简单的重新定位。使用以下代码

window.location = 'index.html';

做它应该做的,我仍然收到一个 TypeScript 错误,上面写着

Assigned expression type string is not assinable to type Location

使用 TypeScript 正确重定位的假定方法是什么?

4

0 回答 0