2023-07-05 21:28:55 +00:00
|
|
|
<template>
|
2024-05-25 04:33:22 +00:00
|
|
|
<CdxTabs v-model:active="currentTab" :framed="framed">
|
|
|
|
<CdxTab
|
2023-07-05 21:28:55 +00:00
|
|
|
v-for="( tab, index ) in tabsData"
|
|
|
|
:key="index"
|
|
|
|
:name="tab.name"
|
|
|
|
:label="tab.label"
|
|
|
|
:disabled="tab.disabled"
|
|
|
|
>
|
2024-05-25 04:33:22 +00:00
|
|
|
<TabContent
|
2023-07-06 00:00:59 +00:00
|
|
|
:html="tab.content"
|
2024-05-25 04:33:22 +00:00
|
|
|
></TabContent>
|
|
|
|
</CdxTab>
|
|
|
|
</CdxTabs>
|
2023-07-05 21:28:55 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
const { defineComponent } = require( 'vue' );
|
|
|
|
// Codex is available from ResourceLoader at runtime and is available without needing a build step.
|
|
|
|
const { CdxTabs, CdxTab } = require( '@wikimedia/codex' );
|
2023-07-06 00:00:59 +00:00
|
|
|
const TabContent = require( './TabContent.vue' );
|
2023-07-05 21:28:55 +00:00
|
|
|
|
|
|
|
// @vue/component
|
|
|
|
module.exports = exports = defineComponent( {
|
|
|
|
name: 'App',
|
|
|
|
compatConfig: {
|
|
|
|
MODE: 3
|
|
|
|
},
|
|
|
|
compilerOptions: {
|
|
|
|
whitespace: 'condense'
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
CdxTabs: CdxTabs,
|
2023-07-06 00:00:59 +00:00
|
|
|
CdxTab: CdxTab,
|
|
|
|
TabContent: TabContent
|
2023-07-05 21:28:55 +00:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
tabberData: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
},
|
|
|
|
framed: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data: function () {
|
|
|
|
return {
|
|
|
|
tabsData: this.tabberData.tabsData,
|
|
|
|
currentTab: this.tabberData.currentTab
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted: function () {
|
|
|
|
this.$el.parentElement.classList.add( 'tabber--live' );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
</script>
|