1. 程式人生 > >vue中filter的用法

vue中filter的用法

cnblogs ring clas test html www ret style spa

  test() {
     var arr1 = ["A", "B", "C","C","A"];
      var rq=arr1.filter(function(x,index,self){
        return self.indexOf(x) == index;
      })
      console.log(rq.toString())
      var arr = ["A", "", "B", null, undefined, "C", "  "];
      var r = arr.filter(function(s) {
        return s && s.trim(); 
      });
      console.log(r)
    }

詳情請見:http://www.cnblogs.com/cjx-work/p/8052865.html

vue中filter的用法