<template>
  <div>
    <el-config-provider :locale="elementPlusLocale">
      <NuxtLayout>
        <NuxtPage />
      </NuxtLayout>
    </el-config-provider>
  </div>
</template>

<script setup lang="ts">
import { ElConfigProvider } from 'element-plus';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import en from 'element-plus/es/locale/lang/en';

const { locale } = useI18n();

const elementPlusLocales = {
  'zh': zhCn,
  'en': en,
}

const elementPlusLocale = computed(() => elementPlusLocales[locale.value] || zhCn);
</script>