<template>
  <div>
    <scroller>
      <input type="file" webkitdirectory directory @change="fileChange">
      <van-row>
        <van-col span="4" v-for="(item,index) in list" :key="index">
          <icon class="bpoint-nav__icon" :name="item.name|jie"/>
        </van-col>
      </van-row>
    </scroller>
  </div>
</template>

<script>
  export default {
    data () {
      return {
        list: []
      }
    },
    filters:{
      jie(msg){
        return msg.split('.')[0]
      }
    },
    created () {
    },
    methods: {
      fileChange(val) {
        if(val.srcElement.files !== null && val.srcElement.files.length > 0){
          var files = val.srcElement.files;
          for (var i = 0; i < files.length; i++) {
            let name = files[i].name;
            let size = Math.round(files[i].size / 1024) + "K";
            if (/\.svg$/ig.test(name)) {
              //这里按业务要求筛选所有dll文件
              this.list.push({'name': name})
            }
          }
        }
      }
    }
  }
</script>

<style scoped lang="less">
</style>
