<script setup>
import { computed } from 'vue';
import { useStore } from 'vuex';

const store = useStore();
const toggleCollapse = () => {
  console.log('Toggle Collapse');
  store.commit('toggleCollapse');
};
const menu = computed(() => store.state.menu);
</script>

<template>
  <h1 class="text-lg font-medium py-3 px-6 shadow">
    <i
      class="el-icon-guide mr-2"
      :class="{ 'text-gray-800': !menu.collapse, 'text-gray-400': menu.collapse }"
      @click="toggleCollapse"
      v-if="menu.show"
    ></i>
    {{ $route.meta.title || '智能大气腐蚀监测平台' }}
  </h1>
</template>
