码迷,mamicode.com
首页 > 其他好文 > 详细

filters常用步骤

时间:2021-02-08 12:27:11      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:ret   filter   hat   sub   lis   cas   bst   const   exp   

let that
export default{}
beforeCreate() {
    that = this;
 },
filters: { 
 dept: data => {
      for (const i in that.deptList) {
        const element = that.deptList[i];
        if (data == element.deptId) {
          return element.name;
        }
      }
    },
    timeFl: data => {
      if (data) {
        data = data.substr(0, 11);
      }
      return data;
    },
    genderFl: data => {
      switch (data) {
        case "0":
          return "女";
        case "1":
          return "男";
      }
    }
  },

filters常用步骤

标签:ret   filter   hat   sub   lis   cas   bst   const   exp   

原文地址:https://www.cnblogs.com/yoututu/p/14385244.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!