emit value if non set on init
This commit is contained in:
@@ -36,10 +36,15 @@ const tabs = ref(
|
|||||||
};
|
};
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
const selectedTab = ref(
|
const selectedTab = ref(
|
||||||
props.modelValue.length == 0 ? tabs.value[0].id : props.modelValue
|
props.modelValue.length == 0 ? tabs.value[0].id : props.modelValue
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (props.modelValue.length == 0) {
|
||||||
|
emits("update:modelValue", selectedTab.value);
|
||||||
|
}
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => selectedTab.value,
|
() => selectedTab.value,
|
||||||
(newValue) => {
|
(newValue) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user