<template>
  <div class="h5_home">
    <div v-for="(item, index) in menus" :key="index">
      <el-button type="primary" @click="handleJump(item.name)">
        {{ item.label }}
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      menus: [
        {
          label: "订单列表",
          name: "h5Order"
        }
      ]
    };
  },
  mounted() {
    this.$http({
      url: this.$http.adornUrl("/sys/menu/nav"),
      method: "get",
      params: this.$http.adornParams()
    }).then(({ data }) => {
      if (data && data.code === 0) {
        sessionStorage.setItem(
          "permissions",
          JSON.stringify(data.permissions || "[]")
        );
      } else {
        sessionStorage.setItem("permissions", "[]");
      }
    });
  },
  methods: {
    handleJump(name) {
      this.$router.replace({ name: name });
    }
  }
};
</script>

<style lang="scss">
.h5_home {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
</style>
