Skip to content

Instantly share code, notes, and snippets.

@sadewole
Last active December 12, 2021 19:58
Show Gist options
  • Save sadewole/bed80b37a15374cee9c11581aecbaf91 to your computer and use it in GitHub Desktop.
Save sadewole/bed80b37a15374cee9c11581aecbaf91 to your computer and use it in GitHub Desktop.
App.vue - Render Tab
<template>
<img alt="Vue logo" src="./assets/logo.png" />
<div style="margin-top: 20px;">
<Tabs
groupName="count"
initialTab="one"
@change="(val: any) => (currentTab = val)"
>
<Tab value="one" label="Tab One"></Tab>
<Tab value="two" label="Tab Two"></Tab>
</Tabs>
<h1>{{ currentTab }}</h1>
</div>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import Tabs from "./components/tabs/Tabs.vue";
import Tab from "./components/tabs/Tab.vue";
export default defineComponent({
name: "App.vue",
components: { Tab, Tabs },
data() {
return { currentTab: "one" };
}
});
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
max-width: 700px;
margin-left: auto;
margin-right: auto;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment