为什么有时候在TS中查看不了具体的类型?

image.png

interface Props {
  className?: string;
  visible?: boolean;
  show?: boolean;
  content?: string;
  text?: string;
}

type Res = Omit<Props, 'visible'> | Omit<Props, 'show'>

想要得到结果:

{
  className?: string;
  show?: boolean;
  content?: string;
  text?: string;
} | {
  className?: string;
  visible?: boolean;
  content?: string;
  text?: string;
}
阅读 1.5k
1 个回答
logo
Microsoft
子站问答
访问
宣传栏