|
@@ -35,6 +35,7 @@ import {useRoute} from "vue-router";
|
|
|
import Logo from '../HeaderV2/Logo.vue'
|
|
|
import XEUtils from "xe-utils";
|
|
|
import router from '@/router'
|
|
|
+import sleep from "@/utils/sleep";
|
|
|
|
|
|
const menuText: Ref<string> = ref('')
|
|
|
const menuRef = ref()
|
|
@@ -112,7 +113,7 @@ const menuLaunch = async path => {
|
|
|
const li = document.getElementById(path)
|
|
|
const div = li.children[0]
|
|
|
const icon = div.getElementsByClassName('el-icon el-sub-menu__icon-arrow')
|
|
|
- if (icon[0].style.transform === 'none') {
|
|
|
+ if (icon.item(0).style.transform === 'none') {
|
|
|
div.click()
|
|
|
}
|
|
|
} catch (e) {
|
|
@@ -163,8 +164,8 @@ const smoothScrolling = () => {
|
|
|
watch(() => router.currentRoute.value, async () => {
|
|
|
menuText.value = ''
|
|
|
isSearch.value = false
|
|
|
- await menuRef.value.handleResize()
|
|
|
await nextTick()
|
|
|
+ await menuRef.value.handleResize()
|
|
|
smoothScrolling()
|
|
|
})
|
|
|
|
|
@@ -172,6 +173,8 @@ watch(() => router.currentRoute.value, async () => {
|
|
|
onMounted(async () => {
|
|
|
await nextTick()
|
|
|
barHeight.height = (floatingRef.value.clientHeight - logoRef.value.clientHeight - 36) + 'px'
|
|
|
+ await sleep(500)
|
|
|
+ smoothScrolling()
|
|
|
})
|
|
|
|
|
|
</script>
|