perf: ️ Optimize startup application performance

This commit is contained in:
viarotel 2024-11-08 15:28:08 +08:00
parent b1a6ba7ae4
commit 8e94494e43

View File

@ -1,18 +1,19 @@
<template> <template>
<el-dropdown <el-dropdown
:hide-on-click="false"
:disabled="loading || floating" :disabled="loading || floating"
max-height="300px" max-height="300px"
trigger="click" trigger="click"
@visible-change="onVisibleChange" @visible-change="onVisibleChange"
@mouseenter="getAppData"
> >
<slot :loading :trigger="handleTrigger" /> <slot :loading :trigger="handleTrigger" />
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item command="search" @click.stop> <div class="sticky top-0 px-2 pt-2 pb-2 bg-white border-b">
<el-input v-model="keyword" class="!w-[calc(100%+18px)] !-mx-[9px] !-mt-1" :placeholder="$t('common.search')" prefix-icon="Search"></el-input> <el-input v-model="keyword" class="!w-full" :placeholder="$t('common.search')" prefix-icon="Search"></el-input>
</el-dropdown-item> </div>
<el-dropdown-item <el-dropdown-item
v-for="item of options" v-for="item of options"
:key="item.value" :key="item.value"
@ -66,8 +67,6 @@ export default {
icon: 'HomeFilled', icon: 'HomeFilled',
}) })
value[0].divided = true
if (this.keyword) { if (this.keyword) {
return value.filter((item) => { return value.filter((item) => {
const pinyinLabel = pinyin(item.label, { toneType: 'none' }) const pinyinLabel = pinyin(item.label, { toneType: 'none' })
@ -78,9 +77,6 @@ export default {
return value return value
}, },
}, },
created() {
this.getAppData()
},
methods: { methods: {
async onVisibleChange(val) { async onVisibleChange(val) {
if (!val) { if (!val) {