<template>

  <div class="container-fluid">
    <nav class="navbar navbar-expand-sm bg-primary navbar-dark">
      <a class="navbar-brand mx-3">梦幻合合合</a>

      <ul class="navbar-nav">
        <li class="nav-item">
          <a class="nav-link" href="#">玩家修改</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#/playerquery">玩家查询</a>
        </li>
        <li class="nav-item">
          <a class="nav-link" href="#/cicd">CICD</a>
        </li>
      </ul>
    </nav>

  </div>

  <component :is="currentView" />
</template>

<script setup>
import { ref, computed } from 'vue'
import NotFound from './components/NotFound.vue'
import Home from './components/PlayerEdit.vue'
import PlayerQuery from './components/PlayerQuery.vue'
import Cicd from './components/Cicd.vue'
const routes = {
  '/': Home,
  '/playerquery': PlayerQuery,
  '/cicd': Cicd,
}
const currentPath = ref(window.location.hash)
window.addEventListener('hashchange', () => {
  currentPath.value = window.location.hash
})
const currentView = computed(() => {
  return routes[currentPath.value.slice(1) || '/'] || NotFound
})
</script>
