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

215
Views
No se puede cerrar un modal en vue a través de v-model

Recibo el siguiente error de la consola cuando presioné el botón mientras se muestra Close :

 "Error: Cannot find module './undefined'" found in ---> <WhatsNew> at src/components/WhatsNew.vue

A continuación se muestra WhatsNew.vue

 <template> <u-modal v-model="modalActive"> ...... ...... <div class="whats-new-options"> <div id="whats-new-checkbox"> <u-checkbox v-model="whatsNewStatusInactive" label="Don't show again"/> </div> <div id="whats-new-next-button"> <u-button id="whats-new-close-btns" full color="secondary" @click="nextNew">{{notViewedAll ? 'Next' : 'Close' }}</u-button> </div> </div> </div> </u-modal> </template>
 <script> import { mapGetters, mapMutations } from "vuex"; export default { data() { return { modalActive: false, notViewedAll: true, newFeaturesOnUsedCount: 3, current: 0, } }, methods: { ...mapMutations("client", ["updateWhatsNewStatus"]), nextNew() { if (this.current <= this.newFeaturesOnUsedCount -1 ){ this.current += 1 } if (this.current >= this.newFeaturesOnUsedCount && !this.notViewedAll) { this.modalActive = false } if (this.current >= this.newFeaturesOnUsedCount - 1) { this.notViewedAll = false } } }

No estoy seguro de qué está causando el error, lo arreglé con una solución de tirita cambiando:

 <u-modal v-model="modalActive">

a

 <u-modal v-model="modalActive" v-if="modalActive">

Sin embargo, esto no se siente bien, no debería necesitar usar v-if para controlar el modal, ¿el v-modal en sí debería ser suficiente? Pero, ¿por qué me sale el error mencionado anteriormente? Gracias

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

0

Intente usar v-show en su lugar y no necesita usar v-model.

 <u-modal v-show="modalActive">

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!