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传参数


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM