<template>
  <div class="home">
    <header>
      <div class="warp">
        <p>图片压缩（护士证专用）</p>
      </div>
    </header>
    <div style="height: 1.4rem"></div>
    <main>
      
    </main>
  </div>
</template>

<script>
// @ is an alias to /src
// import HelloWorld from '@/components/HelloWorld.vue'
import "lrz";

export default {
  name: 'Home',
  data() {
    return {
      // 图片
      upload_file: null,
      // 压缩后图片
      lrz_file: null,
    }
  },
  methods: {
    // 处理图片文件
    processFile: async function(e) {
      let file = e[0]
      if (file) {
        let name = file.name
        console.log('文件压缩开始')
        file = await lrz(file);
        file = file.file;
        file = new File([file], name);
        this.lrz_file = file;
        console.log('文件压缩完成', this.lrz_file)
      }
    }
  },
  components: {
  }
}
</script>

<style scoped lang="scss" type="text/scss">
.home {
  width: 100%;
  max-width: 1024px;
  margin: 0 auto;
  min-height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) !important;
  background-color: #fff;
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    .warp {
      background-color: #fff;
      width: 100%;
      max-width: 1024px;
      margin: 0 auto;
      height: 1.4rem;
      box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1) !important;
      border-bottom: 1px solid #f3f3f3;
      padding: 0 .35rem;
      box-sizing: border-box;
      p {
        font-size: 0.45rem;
        color: #494e5e;
        line-height: 1.4rem;
        width: 7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }
}
</style>