点击菜单切换语言菜单自动弹回
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user