<script>
import PHead from "./head/index.vue";
import PMain from "./main/index.vue";

import UpdateDialog from "@/views/design/updateDialog.vue";

export default {
  components: { PHead, PMain, UpdateDialog },
  data() {
    return {
      user: {},
    };
  },
  mounted() {
    this.user = this.$dataStore.get("user");
    this.$refs.updateDialog.checkUpdate().then(data => {
      if (data) {
        // 有新版本更新
        this.$refs.updateDialog.open(data);
      }
    });
  }
};
</script>

<template>
  <div class="page">
    <p-head :user="user" />
    <p-main />
    <update-dialog ref="updateDialog" />
  </div>
</template>

<style scoped>
.page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
</style>
