hy-app 0.2.7 → 0.2.8
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.
|
@@ -3,7 +3,7 @@ import { getRect, isObject } from '../utils'
|
|
|
3
3
|
import { IOffset, IPlacementVo } from '@/package/components/hy-popover/typing'
|
|
4
4
|
|
|
5
5
|
export function usePopover(visibleArrow = true) {
|
|
6
|
-
const
|
|
6
|
+
const instance = getCurrentInstance()
|
|
7
7
|
const popStyle = ref<CSSProperties>()
|
|
8
8
|
const arrowStyle = ref<string>('')
|
|
9
9
|
const showStyle = ref<string>('')
|
|
@@ -40,7 +40,7 @@ export function usePopover(visibleArrow = true) {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
// 初始化数据获取
|
|
43
|
-
getRect('#target', false,
|
|
43
|
+
getRect('#target', false, instance).then((rect) => {
|
|
44
44
|
if (!rect) return
|
|
45
45
|
left.value = rect.left as number
|
|
46
46
|
bottom.value = rect.bottom as number
|
|
@@ -49,7 +49,7 @@ export function usePopover(visibleArrow = true) {
|
|
|
49
49
|
top.value = rect.top as number
|
|
50
50
|
})
|
|
51
51
|
// 用透明度可在初始化时获取到pop尺寸
|
|
52
|
-
getRect('#pos', false,
|
|
52
|
+
getRect('#pos', false, instance).then((rect) => {
|
|
53
53
|
if (!rect) return
|
|
54
54
|
popWidth.value = rect.width as number
|
|
55
55
|
popHeight.value = rect.height as number
|