"this" not set as underlying vm for getFilterData functions
See original GitHub issueIt seems “this” from the vue instance vm is not made available to the getFilterData functions. No error is thrown because it is just filtering on “undefined”. Filtering works when directly inserting text:return el.description.includes('hello')
.
data: function () {
return {
searchStr: null,
option: {
getFilterData: {
"contains": function(el) {
console.log(this.searchStr) // undefined when called
return el.description.includes(this.searchStr)
}
}
}
}
});
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Microsoft Azure Reviews - G2
Filter 1493 reviews by the users' company size, role or industry to find out how Microsoft ... Azure Virtual Machines are very easy...
Read more >Agilent_E1430A_Manual.pdf - ArtisanTG
The C Interface Libraries for the Agilent E1430A are a set of functions that allow you to program the register-based Agilent E1430A at...
Read more >UnixWare 7.1.4+ Installation and Update Guide
This Install CD: A new UnixWare 7.1.4+ Install CD that sets up a basic UnixWare ... These packages and sets do not need...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Here you, here is the corrected fiddle:
https://jsfiddle.net/dede89/w1tbv83L/7/
Tweaks:
v-for="(val, key)
key and val were invertedvar ctx=this...
):And it worked like a charm…
Thank you David! I realized it was the same issue shortly after posting but wouldn’t have thought to use a method on my own. And again, thanks for producing this component- it’s very handy.