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

123
Views
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
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!