2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
|
|
|
<p>Tabs can be generated dynamically using the standard <i>v-for</i> directive.</p>
|
|
|
|
</DocSectionText>
|
|
|
|
<div class="card">
|
|
|
|
<TabView>
|
|
|
|
<TabPanel v-for="tab in tabs" :key="tab.title" :header="tab.title">
|
2023-10-21 12:32:52 +00:00
|
|
|
<p class="m-0">{{ tab.content }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</TabPanel>
|
|
|
|
</TabView>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tabs: [
|
|
|
|
{ title: 'Tab 1', content: 'Tab 1 Content' },
|
|
|
|
{ title: 'Tab 2', content: 'Tab 2 Content' },
|
|
|
|
{ title: 'Tab 3', content: 'Tab 3 Content' }
|
|
|
|
],
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<TabView>
|
2023-02-28 08:29:30 +00:00
|
|
|
<TabPanel v-for="tab in tabs" :key="tab.title" :header="tab.title">
|
2023-10-21 12:32:52 +00:00
|
|
|
<p class="m-0">{{ tab.content }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</TabPanel>
|
2023-10-15 09:38:39 +00:00
|
|
|
</TabView>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-03-09 11:39:38 +00:00
|
|
|
<div class="card">
|
2023-02-28 08:29:30 +00:00
|
|
|
<TabView>
|
|
|
|
<TabPanel v-for="tab in tabs" :key="tab.title" :header="tab.title">
|
2023-10-21 12:32:52 +00:00
|
|
|
<p class="m-0">{{ tab.content }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</TabPanel>
|
|
|
|
</TabView>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tabs: [
|
|
|
|
{ title: 'Tab 1', content: 'Tab 1 Content' },
|
|
|
|
{ title: 'Tab 2', content: 'Tab 2 Content' },
|
|
|
|
{ title: 'Tab 3', content: 'Tab 3 Content' }
|
|
|
|
]
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-03-09 11:39:38 +00:00
|
|
|
<div class="card">
|
2023-02-28 08:29:30 +00:00
|
|
|
<TabView>
|
|
|
|
<TabPanel v-for="tab in tabs" :key="tab.title" :header="tab.title">
|
2023-10-21 12:32:52 +00:00
|
|
|
<p class="m-0">{{ tab.content }}</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</TabPanel>
|
|
|
|
</TabView>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
const tabs = ref([
|
|
|
|
{ title: 'Tab 1', content: 'Tab 1 Content' },
|
|
|
|
{ title: 'Tab 2', content: 'Tab 2 Content' },
|
|
|
|
{ title: 'Tab 3', content: 'Tab 3 Content' }
|
|
|
|
]);
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|