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

118
Views
Vue.js + Prevenir la inicialización de objetos de clase

Tengo la siguiente clase y sus propiedades inicializadas dentro del constructor. Tengo una función onchange que establece la propiedad 'currentFilter' y quiero que este valor permanezca en el objeto. Sin embargo, cuando se activa la función set, restablece el objeto y el valor de 'currentFilter' se pierde. ¿Cómo puedo retener los valores de las propiedades y evitar que se inicialice cuando tienen valores?

 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!