fix(ApiTree): 多触发一次onchange

pull/38/head
xingyu 2023-10-19 15:02:01 +08:00
parent 4bf34bd64a
commit f3cba6fc27
1 changed files with 1 additions and 5 deletions

View File

@ -40,10 +40,6 @@ const getAttrs = computed(() => {
} }
}) })
function handleChange(...args) {
emit('change', ...args)
}
watch( watch(
() => state.value, () => state.value,
(v) => { (v) => {
@ -110,7 +106,7 @@ async function fetch() {
</script> </script>
<template> <template>
<Tree v-bind="getAttrs" v-model:selected-keys="state" @select="handleChange"> <Tree v-bind="getAttrs" v-model:selected-keys="state">
<template v-for="item in Object.keys(slots)" #[item]="data"> <template v-for="item in Object.keys(slots)" #[item]="data">
<slot :name="item" v-bind="data || {}" /> <slot :name="item" v-bind="data || {}" />
</template> </template>