Tab.vue 587 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <div v-show="active">
  3. <slot></slot>
  4. </div>
  5. </template>
  6. <script>
  7. import { defineComponent } from "@nuxtjs/composition-api"
  8. export default defineComponent({
  9. name: "SmartTab",
  10. props: {
  11. label: { type: String, default: null },
  12. info: { type: String, default: null },
  13. icon: { type: String, default: null },
  14. id: { type: String, default: null, required: true },
  15. selected: {
  16. type: Boolean,
  17. default: false,
  18. },
  19. },
  20. data() {
  21. return {
  22. active: false,
  23. }
  24. },
  25. mounted() {
  26. this.active = this.selected
  27. },
  28. })
  29. </script>