mirror of
https://github.com/kuaifan/dootask.git
synced 2026-10-29 22:10:42 +00:00
perf(project): 看板列头菜单改为首次展开时才渲染菜单项
每列菜单原先预先挂载约 17 个菜单项,18 列的项目约占面板一半的 watcher。改为记录已展开过的列,首次展开时再渲染。 移动端 4 倍降速实测,18 列项目打开时长任务约减半(1357 → 694ms)。
This commit is contained in:
parent
093a1e9afb
commit
db66b7b215
@ -167,10 +167,11 @@
|
||||
v-else-if="!isDepartmentReadonly"
|
||||
trigger="click"
|
||||
size="medium"
|
||||
@visible-change="onColumnMenuVisible(column.id, $event)"
|
||||
@command="dropColumn(column, $event)">
|
||||
<Icon type="ios-more" />
|
||||
<EDropdownMenu slot="dropdown" class="project-panel-more-dropdown-menu">
|
||||
<li class="project-panel-more-dropdown-warp">
|
||||
<li v-if="columnMenuIds.includes(column.id)" class="project-panel-more-dropdown-warp">
|
||||
<ul>
|
||||
<EDropdownItem command="title">
|
||||
<div class="item">
|
||||
@ -742,6 +743,8 @@ export default {
|
||||
return {
|
||||
loading: false,
|
||||
|
||||
columnMenuIds: [],
|
||||
|
||||
nowTime: $A.dayjs().unix(),
|
||||
nowInterval: null,
|
||||
tableToday: $A.daytz().format('YYYY-MM-DD'),
|
||||
@ -1514,6 +1517,12 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
onColumnMenuVisible(columnId, visible) {
|
||||
if (visible && !this.columnMenuIds.includes(columnId)) {
|
||||
this.columnMenuIds.push(columnId)
|
||||
}
|
||||
},
|
||||
|
||||
dropColumn(column, command) {
|
||||
if (this.isDepartmentReadonly) {
|
||||
return;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user