Skip to content

Commit

Permalink
fix(dropdown): 修复dropdown组件在虚拟滚动表格中报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zzcr committed Jul 4, 2024
1 parent 0be22f6 commit 88a092c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 20 deletions.
32 changes: 16 additions & 16 deletions packages/renderless/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
{
"name": "@opentiny/vue-renderless",
"version": "3.16.2",
"private": true,
"version": "3.16.1",
"description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
"author": "OpenTiny Team",
"license": "MIT",
"homepage": "https://opentiny.design/tiny-vue",
"repository": {
"type": "git",
"url": "[email protected]:opentiny/tiny-vue.git"
},
"bugs": {
"url": "https://github.com/opentiny/tiny-vue/issues"
},
"keywords": [
"vue",
"vue3",
Expand All @@ -15,29 +24,20 @@
"renderless-components",
"headless-components"
],
"author": "OpenTiny Team",
"license": "MIT",
"repository": {
"type": "git",
"url": "[email protected]:opentiny/tiny-vue.git"
},
"bugs": {
"url": "https://github.com/opentiny/tiny-vue/issues"
},
"sideEffects": false,
"exports": {
"./package.json": "./package.json",
"./*": "./src/*"
},
"scripts": {
"build": "tsup",
"build:fast": "npm run build && npm run release",
"postversion": "pnpm build",
"release": "esno ./scripts/postbuild.ts && shx cp README.md dist"
},
"dependencies": {
"xss": "1.0.11",
"color": "4.2.3"
},
"exports": {
"./package.json": "./package.json",
"./*": "./src/*"
"color": "4.2.3",
"xss": "1.0.11"
},
"devDependencies": {
"esno": "^0.16.3",
Expand Down
15 changes: 11 additions & 4 deletions packages/renderless/src/dropdown-menu/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,19 @@ export const useVuePopper = ({

onMounted(() => {
if (!dropdownVm) return
dropdownVm.popperElm = popper.popperElm.value = vm.$el
nextTick(() => (popper.referenceElm.value = dropdownVm.$el))

!props.multiStage && dropdownVm.initDomOperation()
if (popper.popperElm) {
dropdownVm.popperElm = popper.popperElm.value = vm.$el
nextTick(() => {
if (popper.referenceElm) {
popper.referenceElm.value = dropdownVm.$el
}
})

!props.multiStage && dropdownVm.initDomOperation()
}

if (dropdownVm.inheritWidth) {
if (dropdownVm.inheritWidth && popper.popperElm) {
dropdownVm.popperElm.style.minWidth = dropdownVm.$el.clientWidth + 'px'
}
})
Expand Down

0 comments on commit 88a092c

Please sign in to comment.