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

166
Views
Vue 3 desmarcando el componente de casilla de verificación personalizado

Hola chicos, tengo el siguiente problema: quiero desmarcar los componentes personalizados de la casilla de verificación después de enviar el formulario. Establecí el modelo v en un objeto vacío después de enviarlo (cuenta.valor = {}), pero la casilla sigue marcada aunque el valor esté vacío.

Niño Checkbox.vue:

 <template> <div class="checkboxContainer"> <label :for="id">{{ text }}</label> <input :id="id" type="checkbox" @change="$emit('update:modelValue', $event.target.checked)" /> </div> </template> <script setup> import { defineProps } from 'vue' defineProps({ text: { default: '', type: String }, id: { default: '', type: String } }) </script>

Parent.vue:

 <template> <form @submit.prevent> <div class="formWrapper"> <Checkbox id="changeEmail" v-model="account.changeEmail" text="Can Change Email: " /> <Checkbox id="changeUser" v-model="account.changeUser" text="Can Change User: " /> <button type="submit" @click="createAccount()">Create</button> </div> </form> </template> <script setup> import { ref } from 'vue' import Checkbox from '@/components/helpers/Checkbox.vue' import axios from 'axios' const account = ref({}) const createAccount = () => { axios .post('/api/account-management/accounts', { can_change_own_email: account.value.changeEmail, can_change_own_user: account.value.changeUser }) .then(() => { account.value = {} }) } </script>
about 4 years ago · Juan Pablo Isaza
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!