如何从打字稿中的文件中导入对象的对象。我知道我可以像import house from 'a/b/c/house'
一样导入。但是我可以只导入parent
吗?所以我不需要像这样写代码house.grandparent.parent.xxx
#filepath: a/b/c/house.ts
const house = {
grandparent: {
parent: {
childa: (text: string) => `s'${text}')`,
childb: 'b',
childc: 'c',
},
},
};
export default house;