Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
How to send emited data to computed property

I'm trying to build a dropdown menu for my Vue3 project to select a country from list. Before that I've been using select>option to list and select country like this;

    <template>
          <select
            class="settings-item settings-text upper shadow-lg shadow-gray-300/50"
            v-model="selectedCountry"
            :disabled="!countries.length"
          >
            <option v-for="country in countries" :key="country.id" :value="country">
              {{ country.name }}
            </option>
          </select>
    </template> 
computed: {
    selectedCountry: {
      get() {
        return this.userCountry
      },
      set(country) {
        this.SET_USER_COUNTRY(country)
        this.SET_COUNTRY_ID(country.id)
        this.fetchCities()
      }
    }
}

But now I have a new component that gets and renders the list, I'm sending selected country data from grandchild component to this parent component now I want to send the data comes from child components and update my computed property again. I think I may write a mehtod to do mutation and fetch cities, but I'm not sure.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda