对象解构时,冒号在语法上是用来对重命名参数的。 所以要对参数结构进行声明类型,需要先写好一个类型, // 声明一个类型type Feature = { id: number, name: string,}function addFeature({ id, name }: Feature) {}