我刚刚从TypeScript 1.5升级到最新版本,我在代码中看到错误:
interface Options {
/* ... others ... */
callbackOnLocationHash?: boolean;
}
function f(opts: Options) { /* ... */ }
// Error: Object literal may only specify known properties,
// and 'callbackOnLoactionHash'does not exist in type 'Options'.
f( { callbackOnLoactionHash: false });
Run Code Online (Sandbox Code Playgroud)
代码看起来很好.怎么了?
(另类宇宙版:我认识到错字,我真的很想写那个.我该怎么做才能删除错误?)
typescript ×1