<template>
  <div id="nav">
    <Button :text="1234" />
    <viewImg
      :list="imgs"
      :key="viewFileKey"
      :visible="showViewImg"
      @callbackview="showViewImg = false"
    />
  </div>
</template>

<script>
import { reactive, toRefs } from '@vue/reactivity';
import Button from "../src/package/button/index.vue";
import viewImg from "../src/package/viewImg/index.vue";

export default {
  name: "App",
  components: {
    Button,
    viewImg,
  },
  setup() { 
    const state = reactive({
      imgs: [
        {
          id: 0,
          url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png'
        },
        {
          id: 1,
          url: 'https://img2.baidu.com/it/u=3114536182,1506614914&fm=253&fmt=auto&app=120&f=JPEG?w=1000&h=655'
        },
        {
          id: 2,
          url: 'https://img2.baidu.com/it/u=4123386159,2839457053&fm=253&fmt=auto&app=138&f=JPEG?w=650&h=448'
        },
        {
          id: 3,
          url: 'https://img2.baidu.com/it/u=1779043861,3055912273&fm=253&fmt=auto&app=120&f=JPEG?w=690&h=1227'
        }
      ],
      viewFileKey: '',
      showViewImg: true,
    })
    return {
      ...toRefs(state)

    }
   }
};
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
