以下三种写法,可以参考:
const handleMenuClick = ({item, key, keyPath}: {item: Object, key: string, keyPath:string}) => {
}
const handleMenuClick = ({item, key, keyPath}: any) => {
}
interface SomeObj {
item: Object
key: string
keyPath:string
}
const handleMenuClick1 = ({item, key, keyPath}: SomeObj) => {
}