From b5b6cb4789bd992fe9e0c3c829b2f2d9a39abbe5 Mon Sep 17 00:00:00 2001 From: gimmyhehe <975402925@qq.com> Date: Fri, 16 Aug 2024 14:24:11 +0800 Subject: [PATCH] fix(grid): [grid] fix panel flash in page (#1903) --- packages/vue/src/grid/package.json | 34 +++++++++---------- .../vue/src/grid/src/filter/src/panel.tsx | 28 ++++++++------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/packages/vue/src/grid/package.json b/packages/vue/src/grid/package.json index 038b973d8..2001e9647 100644 --- a/packages/vue/src/grid/package.json +++ b/packages/vue/src/grid/package.json @@ -1,34 +1,34 @@ { "name": "@opentiny/vue-grid", - "version": "3.18.0", + "type": "module", + "version": "3.18.1", "description": "", + "license": "MIT", + "sideEffects": false, "main": "lib/index.js", "module": "index.ts", - "sideEffects": false, - "type": "module", - "devDependencies": { - "@opentiny-internal/vue-test-utils": "workspace:*", - "vitest": "^0.31.0" - }, "scripts": { "build": "pnpm -w build:ui $npm_package_name", "//postversion": "pnpm build" }, "dependencies": { - "@opentiny/vue-renderless": "workspace:~", - "@opentiny/vue-locale": "workspace:~", - "@opentiny/vue-modal": "workspace:~", + "@opentiny/vue-common": "workspace:~", "@opentiny/vue-dropdown": "workspace:~", "@opentiny/vue-dropdown-item": "workspace:~", "@opentiny/vue-dropdown-menu": "workspace:~", "@opentiny/vue-exception": "workspace:~", - "@opentiny/vue-pager": "workspace:~", "@opentiny/vue-icon": "workspace:~", - "@opentiny/vue-tooltip": "workspace:~", - "@opentiny/vue-theme": "workspace:~", - "@opentiny/vue-tag": "workspace:~", "@opentiny/vue-loading": "workspace:~", - "@opentiny/vue-common": "workspace:~" + "@opentiny/vue-locale": "workspace:~", + "@opentiny/vue-modal": "workspace:~", + "@opentiny/vue-pager": "workspace:~", + "@opentiny/vue-renderless": "workspace:~", + "@opentiny/vue-tag": "workspace:~", + "@opentiny/vue-theme": "workspace:~", + "@opentiny/vue-tooltip": "workspace:~" }, - "license": "MIT" -} \ No newline at end of file + "devDependencies": { + "@opentiny-internal/vue-test-utils": "workspace:*", + "vitest": "^0.31.0" + } +} diff --git a/packages/vue/src/grid/src/filter/src/panel.tsx b/packages/vue/src/grid/src/filter/src/panel.tsx index 80ff20cdd..65d51408e 100644 --- a/packages/vue/src/grid/src/filter/src/panel.tsx +++ b/packages/vue/src/grid/src/filter/src/panel.tsx @@ -1,5 +1,4 @@ /* eslint-disable vue/no-mutating-props */ -/* eslint-disable vue/no-use-computed-property-like-method */ /** * MIT License * @@ -289,20 +288,25 @@ export default defineComponent({ } } - this.popperJS && this.popperJS.destroy() && (this.popperJS = null) - this.$nextTick(() => { - const { targetElemParentTr, id } = this.filterStore - const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`) - const popper = this.$el + if (this.popperJS) { + this.popperJS.destroy() + this.popperJS = null + } + if (this.visible) { + this.$nextTick(() => { + const { targetElemParentTr, id } = this.filterStore + const reference = targetElemParentTr && targetElemParentTr.querySelector(`svg.tiny-grid-filter__btn.${id}`) + const popper = this.$el - popper.style.zIndex = PopupManager.nextZIndex() + popper.style.zIndex = PopupManager.nextZIndex() - if (this.visible) { this.popperJS = new PopperJS(reference, popper, { - placement: 'bottom-end' - }).update() - } - }) + placement: 'bottom-end', + gpuAcceleration: false + }) + popper.style.display = 'block' + }) + } }), // 基础清除选项 renderBase() {