我不明白为什么?
export const CompanyProfileStub: Company = {
id: 1
};
我该如何解决?
export interface Company {
id: bigint;
}
答案 0 :(得分:2)
基本上,您不能将Number
分配给BigInt
,因为它是另一种原语。
您可以使用BigInt
的构造函数在JS中创建BigInt
,如下所示:
const huge = BigInt(9007199254740991)
或在数字末尾使用n
,如下所示:
const huge = 1n