diff --git a/packages/renderless/package.json b/packages/renderless/package.json index 440f717135..0e2d8de603 100644 --- a/packages/renderless/package.json +++ b/packages/renderless/package.json @@ -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": "git@github.com:opentiny/tiny-vue.git" + }, + "bugs": { + "url": "https://github.com/opentiny/tiny-vue/issues" + }, "keywords": [ "vue", "vue3", @@ -15,16 +24,11 @@ "renderless-components", "headless-components" ], - "author": "OpenTiny Team", - "license": "MIT", - "repository": { - "type": "git", - "url": "git@github.com: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", @@ -32,12 +36,8 @@ "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", diff --git a/packages/renderless/src/dropdown-menu/index.ts b/packages/renderless/src/dropdown-menu/index.ts index d2385876fa..376bb810bd 100644 --- a/packages/renderless/src/dropdown-menu/index.ts +++ b/packages/renderless/src/dropdown-menu/index.ts @@ -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' } })