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

89
Views
passing a parameter to a dynamic component

I have a select inside the component. Depending on the value of the select, another component is rendered in the component.

How to pass props to a dynamic component if I render the component like this:

<component :is="valueSelect"></component>

or how to render a dynamic component with parameter passing

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can pass props to the dynamic component by v-bind with an object with each prop key and value

Ex:

<component :is="valueSelect" v-bind="componentProps"></component>


data: function () {
return {
    valueSelect: 'firstComponent',
  }
},
computed: {
  componentProps: function() {
    if (this.valueSelect === 'firstComponent') {
      return { firstProp: 'one' }
    } else if (this.valueSelect === 'secondComponent') {
      return { secondProp: 'two' }
    }
  }
about 4 years ago · Santiago Trujillo 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!