我收到以下 TypeScript 代码错误:
///<reference path='../../../Shared/typescript/jquery.d.ts' />
///<reference path='../../../Shared/typescript/jqueryStatic.d.ts' />
function accessControls(action: Action) {
$('#logoutLink')
.click(function () {
var $link = $(this);
window.location = $link.attr('data-href');
});
}
我收到以下带下划线的红色错误:
$link.attr('data-href');
消息说:
Cannot convert 'string' to 'Location': Type 'String' is missing property 'reload' from type 'Location'
有谁知道这意味着什么?