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