Skip to content

Commit

Permalink
perf: ⚡️ Optimize startup application performance
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 8, 2024
1 parent b1a6ba7 commit 8e94494
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<template>
<el-dropdown
:hide-on-click="false"
:disabled="loading || floating"
max-height="300px"
trigger="click"
@visible-change="onVisibleChange"
@mouseenter="getAppData"
>
<slot :loading :trigger="handleTrigger" />

<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="search" @click.stop>
<el-input v-model="keyword" class="!w-[calc(100%+18px)] !-mx-[9px] !-mt-1" :placeholder="$t('common.search')" prefix-icon="Search"></el-input>
</el-dropdown-item>
<div class="sticky top-0 px-2 pt-2 pb-2 bg-white border-b">
<el-input v-model="keyword" class="!w-full" :placeholder="$t('common.search')" prefix-icon="Search"></el-input>
</div>

<el-dropdown-item
v-for="item of options"
:key="item.value"
Expand Down Expand Up @@ -66,8 +67,6 @@ export default {
icon: 'HomeFilled',
})
value[0].divided = true
if (this.keyword) {
return value.filter((item) => {
const pinyinLabel = pinyin(item.label, { toneType: 'none' })
Expand All @@ -78,9 +77,6 @@ export default {
return value
},
},
created() {
this.getAppData()
},
methods: {
async onVisibleChange(val) {
if (!val) {
Expand Down

0 comments on commit 8e94494

Please sign in to comment.