<template>
  <div v-if="elementPlusLoaded">
    <template v-if="barType == 'top'">
      <UpDown></UpDown>
    </template>
    <template v-else>
      <LeftRight></LeftRight>
    </template>
  </div>
</template>

<script setup>
import useSettingsStore from '@/store/modules/settings'
import LeftRight from './components/LeftRight.vue'
import UpDown from './components/UpDown.vue'
import useAppStore from  '@/store/modules/app'

const elementPlusLoaded = ref(false);
onMounted(async () => {
  const { proxy } = getCurrentInstance();
  // await proxy.$register();
  // 完成异步加载，设置 elementPlusLoaded 为 true
  elementPlusLoaded.value = true;
  useAppStore().setElLoading(true);
});

const settingsStore = useSettingsStore()
const barType = computed(() => settingsStore.barType);
</script>

<style lang="scss" scoped>
</style>