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

  • Vue.js 2.x by Example
  • Mike Street
  • 113字
  • 2021-07-02 20:00:32

Making the filters a component

We now need to make the filtering section its own component. This isn't strictly necessary in this scenario, but it's good practice and gives us more challenges.

The problem we face in making the filtering a component is a challenge of transferring filter data between the filtering component and the team-member component. Vue addresses this with custom events. These let you pass (or "emit") data to the parent or other components from the child component.

We are going to create a filtering component which, on filtering change, passes the data back to the parent Vue instance. This data is already passed through to the team-member component to filter.

主站蜘蛛池模板: 阜康市| 屏山县| 鄂伦春自治旗| 开阳县| 望江县| 正宁县| 浦东新区| 神木县| 肃宁县| 湘潭市| 阿拉善左旗| 固安县| 诏安县| 会东县| 涿州市| 竹北市| 沧州市| 连云港市| 临沭县| 锡林浩特市| 白河县| 综艺| 郑州市| 莆田市| 平邑县| 滨海县| 如东县| 盐山县| 滦南县| 延长县| 公安县| 东乡县| 鸡西市| 玛纳斯县| 平乐县| 阳信县| 富锦市| 柞水县| 长岭县| 甘谷县| 大庆市|