官术网_书友最值得收藏!

Resolving JavaScript errors

As with the team-member component, you are going to experience some errors in your JavaScript console. These can be resolved by copying the filter data object and both the changeFilter and isActiveFilterSelected methods from the parent instance. We'll leave them in both the component and parent instance for now, but we'll remove the duplication later:

      Vue.component('filtering', {
template: '#filtering-template',

data() {
return {
filter: {
field: '',
query: ''
}
}
},

methods: {
isActiveFilterSelected() {
return (this.filter.field === 'isActive');
},

changeFilter(event) {
this.filter.query = '';
this.filter.field = event.target.value;
}
}
});

Running the app will show both the filters and person listing, but the filters won't update the people list as they are not communicating yet.

主站蜘蛛池模板: 大埔县| 镇远县| 江都市| 武邑县| 疏附县| 富宁县| 兰考县| 满洲里市| 元江| 盐城市| 绵竹市| 怀宁县| 莒南县| 抚州市| 博兴县| 大荔县| 宁远县| 疏勒县| 兴城市| 望谟县| 额敏县| 绥阳县| 依安县| 仁化县| 改则县| 芷江| 大城县| 贵溪市| 南宫市| 安庆市| 金湖县| 平遥县| 行唐县| 常山县| 浠水县| 禄丰县| 康马县| 从化市| 九龙坡区| 仁怀市| 修水县|