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

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.

主站蜘蛛池模板: 全椒县| 太仓市| 都江堰市| 长乐市| 宣武区| 双江| 阿克苏市| 阿图什市| 彩票| 苗栗县| 昭苏县| 亚东县| 临沭县| 新闻| 宁波市| 新乐市| 冕宁县| 丰镇市| 博白县| 辽宁省| 临江市| 长阳| 什邡市| 玉山县| 吉木乃县| 桂东县| 四子王旗| 衢州市| 海伦市| 自贡市| 和田县| 开原市| 齐齐哈尔市| 静宁县| 乐亭县| 上林县| 佛山市| 将乐县| 莱州市| 宁阳县| 福鼎市|