点击菜单切换语言菜单自动弹回

This commit is contained in:
zzy
2023-04-19 17:41:10 +08:00
parent 23fca53196
commit 3eb07382ae
16 changed files with 576 additions and 274 deletions
+14 -3
View File
@@ -66,6 +66,15 @@ import { getCurrentInstance, onUnmounted } from 'vue'
import { ipoStore } from "@/stores/ipo"
const store = ipoStore()
const { proxy } = (getCurrentInstance() as any)
let emit = defineEmits(['childfn'])
const props = defineProps({
drawer:Boolean
})
let drawer = props.drawer
console.log(props);
const state = ref(1)
// const drawer = ref(true)
@@ -85,10 +94,12 @@ const setState = (number: number) => {
}
}
const handleLang1 = () => {
if (proxy.$i18n.locale = 'en') {
proxy.$i18n.locale = 'en'
}
store.setLocale(1)
emit('childfn',!drawer)
}
const handleLang2 = () => {
if (proxy.$i18n.locale = 'zhCt') {
@@ -97,16 +108,16 @@ const handleLang2 = () => {
}
store.setLocale(2)
emit('childfn',!drawer)
}
const handleLang3 = () => {
if (proxy.$i18n.locale = 'zhCn') {
proxy.$i18n.locale = 'zhCn'
}
store.setLocale(3)
emit('childfn',!drawer)
}
// const openDrawer = () => {
// drawer.value = false;
// }
</script>
<style lang="scss" scoped>