Making the filtering work again with props

Re-add the v-show="filterRow()" attribute to the containing tr element in your template. As our component has the person cached on each instance, we no longer need to pass the person object to the method. Refreshing the page will give you a new error in your JavaScript console:

Property or method "filterRow" is not defined on the instance but referenced during render

This error is because our component has the v-show attribute, showing and hiding based on our filtering and properties, but not the corresponding filterRow function. As we don't use it for anything else, we can move the method from the Vue instance to the component, adding it to the methods component. Remove the person parameter and ...

Get Vue.js 2.x by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.