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

122
Visualizações
Vue.js + Prevent initialization of Objects of class

I have the below class and its properties initialized within the constructor. I have an onchange function which sets property 'currentFilter' and i want this value to remain in the object However when the set function is triggered it resets the object and the value of 'currentFilter' is lost. How can i retain the values of the properties and prevent it from getting initialized when they have values.

 class Filters
{
    constructor()
    {
        this.isShow = false;
        this.currentFilter = '';
    }
   
    async loadFilters()
    {
        const query = `?$select=*&$filter=_new_table_value eq ${window.parent.Xrm.Page.data.entity.getId().replace(/[{}]/g, "")}&$orderby=ice_name asc`;
        this.Filters = await window.parent.Xrm.WebApi.retrieveMultipleRecords('ice_filterstable', query);
    
        return this;
    }
}

<script>
export default {
data() {
  return {
    filters : {};
 };
},
methods: {,
 set () {
   const filters = new Filters(); 
   this.filters = await filters.loadFilters();
 },
  changeFilter: (itemId, itemText) =>
                {
                    this.filters.isShow = true;
                    this.filters.currentFilter = itemId;
                },
}
about 4 years ago · Santiago Gelvez
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