mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
demo: fix lazy.tsx type (#40778)
Demo 有问题,会在 VSCode中 引用 `loadData`、`onChange` 时 会报错
This commit is contained in:
parent
5199344d09
commit
51200e7732
@ -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);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user