我想dropdownAttributes仅限于DropDownItem界面上的属性。
interface DropDownItem {
[key: string]: any;
}
interface Props {
dropdownList: DropDownItem[];
dropdownAttributes: string[];
}
如果DropDownItem现在有动态属性,我想我可以这样解决这个keyof问题:
interface Props {
dropdownList: DropDownItem[];
dropdownAttributes: (keyof DropDownItem)[];
}
但这在我的情况下现在不起作用。怎么解决?
