This commit is contained in:
zzy
2023-04-17 16:01:46 +08:00
parent 7da913090d
commit 21c1ea7551
7 changed files with 57 additions and 17 deletions
+31 -7
View File
@@ -43,10 +43,10 @@
<img src="@/assets/1x/source11.png" alt="">
</div>
</div>
<div class="lang" v-if="state == 5">
<li>English</li>
<li>简体中文</li>
<li>繁體中文</li>
<div class="lang" v-if="state == 5" >
<li @click="handleLang1">English</li>
<li @click="handleLang2">繁體中文</li>
<li @click="handleLang3">简体中文</li>
</div>
</li>
@@ -63,7 +63,10 @@ export default {
<script lang="ts" setup>
import { ref } from "vue"
import { getCurrentInstance, onUnmounted } from 'vue'
import { ipoStore } from "@/stores/ipo"
const store = ipoStore()
const { proxy } = (getCurrentInstance() as any)
const state = ref(1)
// const drawer = ref(true)
const setState = (number: number) => {
@@ -81,6 +84,26 @@ const setState = (number: number) => {
proxy.$router.push("/IPOcalendar")
}
}
const handleLang1 = () => {
if (proxy.$i18n.locale = 'en') {
proxy.$i18n.locale = 'en'
}
store.setLocale(1)
}
const handleLang2 = () => {
if (proxy.$i18n.locale = 'zhCt') {
proxy.$i18n.locale = 'zhCt'
}
store.setLocale(2)
}
const handleLang3 = () => {
if (proxy.$i18n.locale = 'zhCn') {
proxy.$i18n.locale = 'zhCn'
}
store.setLocale(3)
}
// const openDrawer = () => {
// drawer.value = false;
// }
@@ -93,10 +116,10 @@ const setState = (number: number) => {
display: flex;
flex-direction: column;
.imgWrap22222 {
margin-top: 30rem;
margin-top: 20rem;
width: 25rem;
height: 20rem;
// margin-left: 15rem;
margin-left: 15rem;
img {
width: 100%;
height: 100%;
@@ -118,7 +141,7 @@ const setState = (number: number) => {
background-color: #B4C0C7;
&.active {
background-color: #fff;
background-color: #fff
}
img {
@@ -184,5 +207,6 @@ const setState = (number: number) => {
}
}
}
</style>