fix(ApiCascader): apiParamKey not working

pull/38/head
xingyu 2023-10-23 09:47:57 +08:00
parent ea2be2961c
commit 007ac38d5f
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ const props = defineProps({
labelField: propTypes.string.def('label'), labelField: propTypes.string.def('label'),
valueField: propTypes.string.def('value'), valueField: propTypes.string.def('value'),
childrenField: propTypes.string.def('children'), childrenField: propTypes.string.def('children'),
asyncFetchParamKey: propTypes.string.def('parentCode'), apiParamKey: propTypes.string.def('parentCode'),
immediate: propTypes.bool.def(true), immediate: propTypes.bool.def(true),
// init fetch params // init fetch params
initFetchParams: { initFetchParams: {
@ -120,7 +120,7 @@ async function loadData(selectedOptions: Option[]) {
return return
try { try {
const res = await api({ const res = await api({
[props.asyncFetchParamKey]: Reflect.get(targetOption, 'value'), [props.apiParamKey]: Reflect.get(targetOption, 'value'),
}) })
if (Array.isArray(res)) { if (Array.isArray(res)) {
const children = generatorOptions(res) const children = generatorOptions(res)