-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Closed
Labels
Description
Version
3.0.0-alpha.14
Reproduction link
https://next.antdv.com/components/cascader-cn#API
Steps to reproduce
简略代码
<template>
<a-cascader
v-model:value="data"
:options="options"
:load-data="loadData"
placeholder="Please select"
/>
{{ data }}
</template>
<script>
import { defineComponent, ref } from "vue";
export default defineComponent({
components: {},
setup() {
const data = ref(["1", "1-1"]),
options = ref([
{
value: '1',
label: 'Zhejiang1',
isLeaf: false,
}
]);
const loadData = (selectedOptions) => {
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
setTimeout(() => {
targetOption.loading = false;
targetOption.children = [{
value: `${targetOption.value}-1`,
label: `${targetOption.label}-下级1`,
}, {
value: `${targetOption.value}-2`,
label: `${targetOption.label}-下级2`,
}];
}, 1000);
}
return {
options,
data,
loadData,
};
},
});
</script>
已知存在data = ref(["1", "1-1"]) 的数据值。
当这个值为初始化赋值的时
What is expected?
控件应当在初始化时 帮忙执行loadData来形成完整options的数据链

