//links js
export default{
  data(){
    return {
      kw:'',
      links:[]
    };
  },
  mounted(){
    //onez.data(this,['items']);
  },
  methods:{
    search(kw){
      this.kw=kw;
      this.find();
    },
    clear(){
      this.kw='';
      this.links=[];
    },
    find(){
      var items=[];
      var links=[];
      this.items.forEach((item)=>{
        item.links.forEach((link)=>{
          if(link.name.indexOf(this.kw)!=-1){
            links.push(link);
          }
        });
        if(links.length>=12){
          this.links=links;
          return;
        }
      });
      this.links=links;
    }
  }
}