fix(ApiCascader): wrong api reload (#3536) resolve #3534

This commit is contained in:
xachary 2024-01-11 15:28:45 +08:00 committed by GitHub
parent 0589458b2d
commit 83f16da2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 4 deletions

View File

@ -20,7 +20,7 @@
</template>
<script lang="ts" setup>
import { type Recordable } from '@vben/types';
import { PropType, ref, unref, watch, watchEffect } from 'vue';
import { PropType, ref, unref, watch } from 'vue';
import { Cascader } from 'ant-design-vue';
import type { CascaderProps } from 'ant-design-vue';
import { propTypes } from '@/utils/propTypes';
@ -159,9 +159,15 @@
}
};
watchEffect(() => {
watch(
() => props.immediate,
() => {
props.immediate && initialFetch();
});
},
{
immediate: true,
},
);
watch(
() => props.initFetchParams,