|
@@ -1,14 +1,31 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="sign-layout">
|
|
<div class="sign-layout">
|
|
|
<div class="sign-layout__wrapper">
|
|
<div class="sign-layout__wrapper">
|
|
|
- <div class="header">
|
|
|
|
|
- <div>{{ t('app.name') }}</div>
|
|
|
|
|
- <div class="header-version">v1.0.{{ version }}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="body">
|
|
|
|
|
- <div class="body-container">
|
|
|
|
|
- <h1 class="body-title">{{ title }}</h1>
|
|
|
|
|
- <slot></slot>
|
|
|
|
|
|
|
+ <el-dropdown class="language" trigger="click">
|
|
|
|
|
+ <el-button link>
|
|
|
|
|
+ <span>{{ languageLabel }}</span>
|
|
|
|
|
+ <el-icon class="el-icon--right">
|
|
|
|
|
+ <arrow-down />
|
|
|
|
|
+ </el-icon>
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <template #dropdown>
|
|
|
|
|
+ <el-dropdown-menu>
|
|
|
|
|
+ <template v-for="item in getLanguageList()" :key="item.value">
|
|
|
|
|
+ <el-dropdown-item @click="switchLanguage(item.value)">{{ item.label }}</el-dropdown-item>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dropdown-menu>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dropdown>
|
|
|
|
|
+ <div style="box-shadow: 0 10px 15px rgba(42, 65, 93, 0.1);">
|
|
|
|
|
+ <div class="header">
|
|
|
|
|
+ <div>{{ t('app.name') }}</div>
|
|
|
|
|
+ <div class="header-version">v1.0.{{ version }}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="body">
|
|
|
|
|
+ <div class="body-container">
|
|
|
|
|
+ <h1 class="body-title">{{ title }}</h1>
|
|
|
|
|
+ <slot></slot>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -16,8 +33,10 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-
|
|
|
|
|
|
|
+import { computed } from 'vue'
|
|
|
|
|
+import { getLanguageList, getLanguageLabelByValue, Language } from '@/constants/language'
|
|
|
import { i18n } from '@/stores'
|
|
import { i18n } from '@/stores'
|
|
|
|
|
+import { localData } from '@/stores/storage'
|
|
|
|
|
|
|
|
defineProps({
|
|
defineProps({
|
|
|
title: {
|
|
title: {
|
|
@@ -30,6 +49,15 @@ const t = i18n.global.t
|
|
|
|
|
|
|
|
const meta = document.getElementsByTagName('meta')
|
|
const meta = document.getElementsByTagName('meta')
|
|
|
const version = meta.namedItem('revised')?.content ?? '0'
|
|
const version = meta.namedItem('revised')?.content ?? '0'
|
|
|
|
|
+
|
|
|
|
|
+// 当前语言
|
|
|
|
|
+const languageLabel = computed(() => getLanguageLabelByValue(i18n.global.locale))
|
|
|
|
|
+
|
|
|
|
|
+// 切换语言
|
|
|
|
|
+const switchLanguage = (lange: Language) => {
|
|
|
|
|
+ i18n.global.locale = lange
|
|
|
|
|
+ localData.setValue('appLanguage', lange)
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less">
|
|
<style lang="less">
|