mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-14 04:32:49 +00:00
perf: 优化长按消息菜单位置
This commit is contained in:
parent
1b1406a4d9
commit
92d757662a
@ -307,7 +307,7 @@
|
|||||||
transferClassName="dialog-wrapper-operate"
|
transferClassName="dialog-wrapper-operate"
|
||||||
transfer>
|
transfer>
|
||||||
<div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div>
|
<div :style="{userSelect:operateVisible ? 'none' : 'auto', height: operateStyles.height}"></div>
|
||||||
<DropdownMenu slot="list">
|
<DropdownMenu slot="list" v-resize-observer="handleOperateResize">
|
||||||
<template v-if="!operateItem.created_at">
|
<template v-if="!operateItem.created_at">
|
||||||
<DropdownItem name="action">
|
<DropdownItem name="action">
|
||||||
<ul class="operate-action cancel">
|
<ul class="operate-action cancel">
|
||||||
@ -661,6 +661,7 @@ import DialogComplaint from "./DialogComplaint";
|
|||||||
import touchclick from "../../../directives/touchclick";
|
import touchclick from "../../../directives/touchclick";
|
||||||
import longpress from "../../../directives/longpress";
|
import longpress from "../../../directives/longpress";
|
||||||
import TransferDom from "../../../directives/transfer-dom";
|
import TransferDom from "../../../directives/transfer-dom";
|
||||||
|
import resizeObserver from "../../../directives/resize-observer";
|
||||||
import {languageList} from "../../../language";
|
import {languageList} from "../../../language";
|
||||||
import {isLocalResourcePath} from "../../../components/Replace/utils";
|
import {isLocalResourcePath} from "../../../components/Replace/utils";
|
||||||
import emitter from "../../../store/events";
|
import emitter from "../../../store/events";
|
||||||
@ -686,7 +687,7 @@ export default {
|
|||||||
DialogGroupVote,
|
DialogGroupVote,
|
||||||
DialogComplaint,
|
DialogComplaint,
|
||||||
},
|
},
|
||||||
directives: {touchclick, longpress, TransferDom},
|
directives: {touchclick, longpress, TransferDom, resizeObserver},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
dialogId: {
|
dialogId: {
|
||||||
@ -3183,12 +3184,18 @@ export default {
|
|||||||
x: operatePosition.left,
|
x: operatePosition.left,
|
||||||
y: this.operateItem.clientY
|
y: this.operateItem.clientY
|
||||||
};
|
};
|
||||||
|
if (this.operateVisible) {
|
||||||
|
this.handleOperateResize()
|
||||||
|
} else {
|
||||||
|
this.operateVisible = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
handleOperateResize() {
|
||||||
if (this.operateVisible) {
|
if (this.operateVisible) {
|
||||||
try {
|
try {
|
||||||
this.$refs.operate.$refs.drop.popper.update()
|
this.$refs.operate.$refs.drop.popper.update()
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
} else {
|
|
||||||
this.operateVisible = true;
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user