sh-view 2.4.9 → 2.4.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-view",
3
- "version": "2.4.9",
3
+ "version": "2.4.10",
4
4
  "description": "基于vxe-table二次封装",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div v-if="showChildren(menuItem)" class="sh-menu-group" :class="groupClass">
3
3
  <menuItemContent ref="groupItemRef" :menu-item="menuItem" :menu-level="menuLevel" :arrow="isArrow" @click="onMenuExpand(!expand)" />
4
- <div v-show="expand" ref="groupList" class="sh-menu-group-list" :class="groupListClass" :style="groupListStyle">
4
+ <div v-show="expand" ref="groupListRef" class="sh-menu-group-list" :class="groupListClass" :style="groupListStyle">
5
5
  <template v-for="(item, index) in menuItem.children" :key="`sh-menu-${menuLevel}-${index}`">
6
6
  <menuGroupContent :menu-item="item" :menu-level="menuNextLevel" />
7
7
  </template>
@@ -39,6 +39,7 @@ export default defineComponent({
39
39
  const MenuInstance = inject('MenuInstance')
40
40
 
41
41
  const groupItemRef = ref()
42
+ const groupListRef = ref()
42
43
  const expand = ref(false)
43
44
  const groupListStyle = ref({})
44
45
 
@@ -66,7 +67,8 @@ export default defineComponent({
66
67
  expand.value = MenuInstance.openedNames.includes(props.menuItem.name)
67
68
  if (expand.value && groupItemRef.value && ((mode === 'vertical' && collapsed) || mode === 'horizontal')) {
68
69
  nextTick(() => {
69
- const { offsetHeight, offsetWidth, itemRef } = groupItemRef.value
70
+ const { offsetHeight, offsetWidth } = groupListRef.value
71
+ const { itemRef } = groupItemRef.value
70
72
  const { left, right, top, bottom } = itemRef.getBoundingClientRect()
71
73
  const winWidth = window.innerWidth
72
74
  const winHeight = window.innerHeight
@@ -116,6 +118,7 @@ export default defineComponent({
116
118
 
117
119
  return {
118
120
  groupItemRef,
121
+ groupListRef,
119
122
  groupClass,
120
123
  groupListClass,
121
124
  groupListStyle,