我有两种const spawnMeteorP = () => {
setInterval(() => {
let x, y;
if (Math.random() < 0.5) {
x = Math.random() < 0.5 ? -50 : cvs.width + 50;
y = Math.random() * cvs.height;
} else {
x = Math.random() * cvs.width;
y = Math.random() < .5 ? -50 : cvs.height + 50
}
const angle = Math.atan2(rocketY - y, rocketX - x);
const velocity = {
x: Math.cos(angle),
y: Math.sin(angle)
}
meteors.push(new MeteorP(x, y, velocity))
}, 1500)
}
:
Frontmatter
,这是一个带有 FrontmatterTaxonomy
和 kind: "taxonomy"
的对象,taxnomyName
。string
,这是一个带有 FrontmatterContent
的对象,它也应该允许任何其他键,只要它们的值是 kind: "content"
。我不确定如何对此建模 - 到目前为止,我尝试了相当简单的方法,但这不起作用,因为 string[]
不是 "content"
类型。
我怎样才能做到这一点?
"TaxonomyTerms"