Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
How to use tabs on setup composition api

I define tabs as prop, then I want to use in function inside setup() as tabs.value..., but it does not recognize property. It is throwing error:

Cannot find name 'tabs', tabs is not defined

Code:

<script lang="ts">
import {
  defineComponent,
  ref,
  computed,
  PropType,
  toRefs,
} from '@vue/composition-api'
import i18n from '@/setup/i18n'

export default defineComponent({
  name: 'ProgramModal',

  props: {
    tabs: Array as PropType<Array<any>>,
  },

  setup() {
 
    const changeTab = (selectedTab: { id: number }) => {
      tabs.value.map((t) => {
        t.id === selectedTab.id ? (t.current = true) : (t.current = false)
      })
    }

    return {
      tabs,
      changeTab,
      ariaLabel,
    }
  },
})
</script>

How can I

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You need to pass props to setup function:

setup(props) {...
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!