在TS中不能将类型Timeout分配给类型number
● 使用window.setTimeout
不能将类型“{}”分配给类型“IntrinsicAttributes & Partial<{ title: string; }> & Omit<Readonly<{ title?: unknown; xLabels?: unknown; values?: unknown; } & { title: string; xLabels: string[]; values: any[]; } & {}> & VNodeProps & AllowedComponentProps & ComponentCustomProps, “title”>”。
● 解决:在子组件中将props定义为可选类型