Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watching Object & String at the same time #10

Open
TerryCaliendo-WealthCounsel opened this issue Jun 7, 2022 · 0 comments
Open

Watching Object & String at the same time #10

TerryCaliendo-WealthCounsel opened this issue Jun 7, 2022 · 0 comments

Comments

@TerryCaliendo-WealthCounsel

I'm trying to store the state of a search query on Vuetify's V-Data-Table along with some user typed filter text. The code is similar to below. Any initial thoughts as to why adding the "options" to the "url" causes "filterText" to be undefined?

data() {
    return {
      filterText: '',
      options: { sortBy: ['sortName'], mustSort: true },
   }
}
url: {
   // Including the "options" line below causes filterText to be undefined in the Watcher below
   // Removing the "options" line below,  filterText is an empty string (as defined in the data section above) in the watcher below
    options: 'options',  
    filterText: 'filterText',
  }
watch: {
    options: {
      handler() {
           // Vuetify's data table modifies the 'options' object and this handler always gets fired 
          //  If "options" is specified in the "url" option above, "this.filterText" is UNDEFINED at this point. 
         //      It should be an empty string as defined in the data section
          this.getContacts()
        }
      },
      deep: true,
    },
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant