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

96
Views
La propiedad Vue no se pasa al componente secundario

Parece ridículo que no pueda hacer que esto funcione, pero cuando se pasa una propiedad a un componente secundario, el valor de la propiedad en realidad nunca cambia y disableFooterText siempre es falso. ¿Estoy haciendo algo mal?

Padre:

 <MyChildComponent :disableFooterText="true">

Niño:

 <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

Prueba con el accesorio kebab-case :

 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

Pruebe el caso de kebab como @Nikola Pavicevic le pidió que hiciera, o intente 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!