Open houguang opened 7 months ago
5.34.0
//地区选择 const [area, setArea] = useState([] as PickerColumn[]) const [selectedArea, setSelectedArea] = useState("") const [areaPickerState, {toggle: areaToggle}] = useToggle(false); const fetchArea = (course_id: number) => { request.get("/m/area", {params: {course_id}}).then((res) => { const data = [] as PickerColumn; // 配置FieldNamesType 参数后这里就不是遍历转换字段名称 res.data.map((item: Area, index: number) => { data[index] = {label: item.name, value: item.id}; }) setArea([data]) }) }
功能类似(https://arco.design/react/components/cascader#fieldnamestype)
Version of antd-mobile
5.34.0
What is this feature about?
功能类似(https://arco.design/react/components/cascader#fieldnamestype)