Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

125
Visualizações
Vue.js + Trigger only one event

I have the below dropdown created using li and within the dropdown i want to provide the delete functionality as well. If 'X' is clicked the record must be deleted. However when i click on 'X' it also triggers 'changeFilter' which is also inside the same li. is there a way i can prevent the 'changeFilter' trigger?

enter image description here Below is the code -

<ul>
            <li v-on:click="createNew">Create new Filter</li>
            <li v-for="item in filters.entities" v-on:click="filter.changeFilter(item.id,item.name)">{{ item.name }}<div title="Delete filter" v-on:click="delete(item.id)">x</div></li>
        </ul>

//Inside js file 

delete: (itemId) => {
                    var result = window.parent.Xrm.WebApi.deleteRecord('ice_filters', itemId.toString());
                   
                }
about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

Try out to add the stop modifier to stop the event propagation from child to parent element :

<div title="Delete filter" v-on:click.stop="delete(item.id)">x</div>

about 4 years ago · Santiago Gelvez Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda