0๐
โ
I got this to work using a temp variable
data(){
return: {
text: "",
temp: {
text
}
}
}
computed(){
filteredList(){
var temporaryList,originalList,filteredList
if ((this.text === $store.state.selectedText )||
(this.text === this.temp.text ) ) {
return temporaryList || originalList
}
// update
this.temp.text = this.text
return filteredList
}
}
thought it would be a bad practice to update variables within a Computed method.
0๐
Create a variable, changed
. Watch selectedItem.text
, and set changed
to true
. In a watcher on text
, set changed
to false
.
Source:stackexchange.com