我试图创建一个像
mongodb document
一样的
当我将鼠标悬停在
IUserModel
上时,它给出了这样的错误
Location“Location”类型中缺少以下属性:ancestorOrigins、hash、host、hostname 以及其他 9 个属性。
我有一个简单的 .ts 文件:
interface Location {
name: string;
id: number;
}
const location1: Location = {
name: 'oakland',
id: 1,
};
错误提示:
输入 '{ 名称:字符串;身份证号; }' 缺少以下内容 “位置”类型的属性:ancestorOrigins、哈希值、主机、 主机名,还有 9 个。
根据我的发现,我认为它来自于: https://developer.mozilla.org/en-US/docs/Web/API/Location
我不明白为什么当我只使用 typescript 时会给我一个 HTML DOM api 错误。