@@ -2,7 +2,16 @@ import { handlePopEvent, handleRefEvent, toggleShow } from './new-index'
2
2
import { userPopper , useTimer } from '@opentiny/vue-hooks'
3
3
import { guid } from '@opentiny/utils'
4
4
5
- export const api = [ 'state' , 'handlePopEvent' , 'handleRefEvent' ]
5
+ export const api = [
6
+ 'state' ,
7
+ 'handlePopEvent' ,
8
+ 'handleRefEvent' ,
9
+ 'show' ,
10
+ 'hide' ,
11
+ 'updatePopper' ,
12
+ 'setExpectedState' ,
13
+ 'debounceClose'
14
+ ]
6
15
7
16
export const renderless = (
8
17
props ,
@@ -11,7 +20,7 @@ export const renderless = (
11
20
) => {
12
21
const api = { } as any
13
22
const popperVmRef = { }
14
- const { showPopper, updatePopper, popperElm, referenceElm } = userPopper ( {
23
+ const { showPopper, updatePopper, popperElm, referenceElm, currentPlacement } = userPopper ( {
15
24
emit,
16
25
props,
17
26
nextTick,
@@ -31,6 +40,8 @@ export const renderless = (
31
40
showPopper,
32
41
popperElm,
33
42
referenceElm,
43
+ // 适配以前用法
44
+ currentPlacement,
34
45
tooltipId : guid ( 'tiny-tooltip-' , 4 ) ,
35
46
showContent : inject ( 'showContent' , null ) ,
36
47
tipsMaxWidth : inject ( 'tips-max-width' , null )
@@ -50,7 +61,13 @@ export const renderless = (
50
61
cancelDelayHide,
51
62
delayHideAfter,
52
63
handlePopEvent : handlePopEvent ( { props, api } ) ,
53
- handleRefEvent : handleRefEvent ( { props, api } )
64
+ handleRefEvent : handleRefEvent ( { props, api } ) ,
65
+ // 适配以前用法
66
+ show : delayShow ,
67
+ hide : delayHide ,
68
+ updatePopper,
69
+ setExpectedState : ( ) => { } ,
70
+ debounceClose : delayHide
54
71
} )
55
72
watch (
56
73
( ) => props . modelValue ,
0 commit comments