track tab changes with event

This commit is contained in:
cgfhtw
2024-01-03 15:38:39 +01:00
parent 9a81111ebc
commit b4505536f6
+11 -2
View File
@@ -6,7 +6,9 @@ export default {
accessibility
},
emits: [
'update:modelValue'
'update:modelValue',
'change',
'changed'
],
props: {
configUrl: String,
@@ -35,6 +37,13 @@ export default {
}
}
},
methods: {
change(key) {
this.$emit("change", key)
this.current = key;
this.$nextTick(() => this.$emit("changed", key));
}
},
created() {
CoreRESTClient
.get(this.configUrl)
@@ -87,7 +96,7 @@ export default {
:key="tab.key"
class="nav-item nav-link"
:class="{active: tab.key == current}"
@click="current=tab.key"
@click="change(tab.key)"
:aria-current="tab.key == current ? 'page' : ''"
v-accessibility:tab
>