一,官方文档:https://ant.design/components/cascader-cn/#header
二,具体代码(以根据产品类型获取产品为例):
import React, { Component } from 'react';
import { Cascader,Form,} from 'antd';
//级联获取产品类型
const getProductType= () => axios.post(config.HOST + '/work/getProductType', qs.stringify({
userToken: JSON.parse(localStorage.getItem('user')).token,
})).then(function (response) {
return response.data;
}).catch(function (error) {
console.log(error);
});
//级联根据产品类型获取产品
const getProductOfType= (productTypeName) => axios.post(config.HOST + '/work/getProductOfType', qs.stringify({
userToken: JSON.parse(localStorage.getItem('user')).token,
productTypeName:productTypeName,
})).then(function (response) {
return response.data;
}).catch(function (error) {
consol