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

98
Views
Vue property isn't getting passed to child component

It seems ridiculous that I can't get this to work, but when passing a prop to a child component, the value of the prop never actually changes and disableFooterText is always false. Am I doing something wrong?

Parent:

<MyChildComponent :disableFooterText="true">

Child:

<MyCustomDropdown :footerText="footerText">

props: {
  disableFooterText: {
    default: false,
    type: Boolean
  },
}

computed: {
  footerText() {
    if (this.disableFooterText) { // always false
      return '';
    }
    return 'Lorem impsum';    // always returns this value
  },
}
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Try with kebab-case prop:

const app = Vue.createApp({})

app.component('my-child-component', {
  template: `
    <div>
      <p>{{numResultsText}}</p>
    </div>
  `,
  props: {
    disableFooterText: {
      type: Boolean,
      default: false,
    },
  },
  computed: {
    numResultsText() {
      if (this.disableFooterText) { // always false
        return this.disableFooterText;
      }
      return 'Lorem impsum';    // always returns this value
    },
  },
})

app.mount('#demo')
<script src="https://cdn.jsdelivr.net/npm/vue@3/dist/vue.global.prod.js"></script>
<div id="demo">
   <my-child-component :disable-footer-text="true" />
</div>

about 4 years ago · Juan Pablo Isaza Report

0

Try kebab case as @Nikola Pavicevic asked you to do, or try a v-bind="{ disableFooterText: true }".

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!