Vue -computed传参数

  computed: {
    levelOneMenus() {
      return this.lists.filter(function(item) {
        return item.level === 1;
      });
    },
    levelThMenus(id) {
      return function(id) {
        return this.lists.filter(function(item) {
          return item.parentId === id;
        });
      };
    }
  },
        <ul class="menu-leveltwo">
          <li v-for="(item1,index1) in levelThMenus(item.id)" :key="index1">
            <a v-bind:href="item1.link" target="_blank">{{item1.title}}</a>
          </li>
        </ul>

 

 

https://yq.aliyun.com/articles/682495 Vue -computed传参数

posted @ 2019-06-11 08:10  BloggerSb  阅读(1193)  评论(0编辑  收藏  举报