Skip to content
Snippets Groups Projects
Commit f69498d1 authored by Ron Lucke's avatar Ron Lucke Committed by Elmar Ludwig
Browse files

fix #3072

Closes #3072

Merge request studip/studip!2063
parent fd13a3d9
No related branches found
No related tags found
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="cw-tabs"> <div class="cw-tabs">
<div role="tablist" class="cw-tabs-nav"> <div role="tablist" class="cw-tabs-nav">
<button <button
v-for="(tab, index) in sortedTabs" v-for="(tab, index) in tabs"
:key="index" :key="index"
:class="[ :class="[
tab.isActive ? 'is-active' : '', tab.isActive ? 'is-active' : '',
...@@ -30,22 +30,17 @@ ...@@ -30,22 +30,17 @@
export default { export default {
name: 'courseware-tabs', name: 'courseware-tabs',
props: { props: {
setSelected: { type: Number, required: false, default: 0 } setSelected: { type: Number, required: false, default: 0 },
}, },
data() { data() {
return { return {
tabs: [], tabs: [],
}; };
}, },
computed: { created() {
sortedTabs() { this.tabs = this.$children.sort((a, b) => {
return [...this.tabs].sort((a, b) => {
return a.index - b.index; return a.index - b.index;
}); });
}
},
created() {
this.tabs = this.$children;
}, },
methods: { methods: {
selectTab(selectorId) { selectTab(selectorId) {
...@@ -101,7 +96,7 @@ export default { ...@@ -101,7 +96,7 @@ export default {
return this.$refs[id][0]; return this.$refs[id][0];
}, },
getFirstTabButton() { getFirstTabButton() {
let selectorId = this.sortedTabs[0].selectorId; let selectorId = this.tabs[0].selectorId;
return this.$refs[selectorId][0]; return this.$refs[selectorId][0];
}, },
getTabButtonByName(name) { getTabButtonByName(name) {
...@@ -132,7 +127,7 @@ export default { ...@@ -132,7 +127,7 @@ export default {
watch: { watch: {
setSelected(tab) { setSelected(tab) {
this.selectTabByIndex(tab); this.selectTabByIndex(tab);
} },
} },
}; };
</script> </script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment