demo: fix lazy.tsx type (#40778)

Demo 有问题,会在 VSCode中 引用 `loadData`、`onChange` 时 会报错
This commit is contained in:
shitian9 2023-02-17 22:10:23 +08:00 committed by GitHub
parent 5199344d09
commit 51200e7732
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,8 +2,8 @@ import React, { useState } from 'react';
import { Cascader } from 'antd';
interface Option {
value: string;
label: string;
value?: string | number | null;
label: React.ReactNode;
children?: Option[];
isLeaf?: boolean;
loading?: boolean;
@ -25,7 +25,7 @@ const optionLists: Option[] = [
const App: React.FC = () => {
const [options, setOptions] = useState<Option[]>(optionLists);
const onChange = (value: string[], selectedOptions: Option[]) => {
const onChange = (value: (string | number)[], selectedOptions: Option[]) => {
console.log(value, selectedOptions);
};