<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import { ElMessage } from 'element-plus'
const getQueryVariable = (variable: string) => {
  if (window.location.hash.indexOf("?") < 0) {
    return null;
  }
  let query = window.location.hash.split("?")[1];
  let vars = query.split("&");
  for (let i = 0; i < vars.length; i++) {
    let pair = vars[i].split("=");
    if (pair[0] == variable) {
      return pair[1];
    }
  }
  return false;
}
const roomUid = getQueryVariable("roomUid") || sessionStorage.getItem("roomUid");
if(!roomUid) {
  ElMessage.error('房间不存在')
} else {
  sessionStorage.setItem("roomUid", roomUid);
}
</script>

<template>
  <!-- <img alt="Vue logo" src="./assets/logo.png" /> -->
  <!-- <HelloWorld msg="Hello Vue 3 + TypeScript + Vite" /> -->
  <router-view v-slot="{ Component }">
    <component :is="Component" />
  </router-view>
</template>

<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;
}

* {
  margin: 0;
  padding: 0;
  touch-action: none !important;
}
[v-cloak] {
  display: none !important;
}
body {
  background-color: #eef4f9 !important;
}

::-webkit-scrollbar {
  width: 8px; /* 纵向滚动条*/
  height: 8px; /* 横向滚动条 */
  background-color: #fff;
}

/*定义滚动条轨道 内阴影*/
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0);
  background-color: #fff;
}

/*定义滑块 内阴影*/
::-webkit-scrollbar-thumb {
  -webkit-box-shadow: inset 0 0 8px rgba(0, 0, 0, 0);
  background-color: #d5d5d5;
}

.el-dialog {
  margin-bottom: 10vh;
  .el-dialog__header {
    // background: #363d55;
    background: var(--color-primary);
    padding: 15px 20px 15px;
    .el-dialog__title {
      color: #fff;
    }
    .el-dialog__headerbtn .el-dialog__close {
      color: #fff;
    }
  }
}
</style>
