File tree Expand file tree Collapse file tree 6 files changed +23
-7
lines changed
tdesign-vue-next/.changelog Expand file tree Collapse file tree 6 files changed +23
-7
lines changed Original file line number Diff line number Diff line change 11:: BASE_DOC ::
22
33## API
4+
45### Popup Props
56
67name | type | default | description | required
@@ -42,6 +43,7 @@ visible-change | `(visible: boolean, context: PopupVisibleChangeContext)` | [see
4243
4344name | params | return | description
4445-- | -- | -- | --
45- getOverlay | \- | ` HTMLElement ` | used to get overly html element
46+ getOverlay | \- | ` HTMLElement \| null ` | used to get overly html element
4647getOverlayState | \- | ` { hover: boolean } ` | get mouseover state of overlay
48+ getPopper | \- | ` Instance \| null ` | get the popup component popper instance。[ see more ts definition] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/popup/type.ts ) 。<br />` import { Instance } from '@popperjs/core' ` <br />
4749update | \- | \- | used to update overlay content
Original file line number Diff line number Diff line change 3737如果您不确定问题是否是由该规则引起的,或者确定该规则不是问题的根本原因,请在 ` GitHub ` 上提出一个 ` issue ` ,并提供可以重现问题的代码。这将有助于我们更好地了解您的问题并提供更好的帮助。
3838
3939## API
40+
4041### Popup Props
4142
42- 名称 | 类型 | 默认值 | 说明 | 必传
43+ 名称 | 类型 | 默认值 | 描述 | 必传
4344-- | -- | -- | -- | --
44- attach | String / Function | 'body' | 制定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:` AttachNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
45+ attach | String / Function | 'body' | 指定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body。TS 类型:` AttachNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
4546content | String / Slot / Function | - | 浮层里面的内容。TS 类型:` string \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
4647default | String / Slot / Function | - | 触发元素,同 triggerElement。TS 类型:` string \| TNode ` 。[ 通用类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/common.ts ) | N
4748delay | Number / Array | - | 延时显示或隐藏浮层,[ 延迟显示的时间,延迟隐藏的时间] ,单位:毫秒。如果只有一个时间,则表示显示和隐藏的延迟时间相同。示例 ` '300' ` 或者 ` [200, 200] ` 。默认为:[ 250, 150] 。TS 类型:` number \| Array<number> ` | N
@@ -78,6 +79,7 @@ visible-change | `(visible: boolean, context: PopupVisibleChangeContext)` | 当
7879
7980名称 | 参数 | 返回值 | 描述
8081-- | -- | -- | --
81- getOverlay | \- | ` HTMLElement ` | 获取浮层元素
82+ getOverlay | \- | ` HTMLElement \| null ` | 获取浮层元素
8283getOverlayState | \- | ` { hover: boolean } ` | 获取浮层悬浮状态
84+ getPopper | \- | ` Instance \| null ` | 获取当前组件 popper 实例。[ 详细类型定义] ( https://github.com/Tencent/tdesign-vue-next/blob/develop/packages/components/popup/type.ts ) 。<br />` import { Instance } from '@popperjs/core' ` <br />
8385update | \- | \- | 更新浮层内容
Original file line number Diff line number Diff line change @@ -249,6 +249,7 @@ export default defineComponent({
249249 getOverlayState : ( ) => ( {
250250 hover : isOverlayHover . value ,
251251 } ) ,
252+ getPopper : ( ) => popper ,
252253 /** close is going to be deprecated. visible is enough */
253254 close : ( ) => hide ( ) ,
254255 } ) ;
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { TdPopupProps } from './type';
88import { PropType } from 'vue' ;
99
1010export default {
11- /** 制定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body */
11+ /** 指定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body */
1212 attach : {
1313 type : [ String , Function ] as PropType < TdPopupProps [ 'attach' ] > ,
1414 default : 'body' as TdPopupProps [ 'attach' ] ,
Original file line number Diff line number Diff line change 44 * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
55 * */
66
7+ import { Instance } from '@popperjs/core' ;
78import { TNode , ClassName , Styles , AttachNode } from '../common' ;
89
910export interface TdPopupProps {
1011 /**
11- * 制定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
12+ * 指定挂载节点 。数据类型为 String 时,会被当作选择器处理,进行节点查询。示例:'body' 或 () => document.body
1213 * @default 'body'
1314 */
1415 attach ?: AttachNode ;
@@ -116,11 +117,15 @@ export interface PopupInstanceFunctions {
116117 /**
117118 * 获取浮层元素
118119 */
119- getOverlay ?: ( ) => HTMLElement ;
120+ getOverlay ?: ( ) => HTMLElement | null ;
120121 /**
121122 * 获取浮层悬浮状态
122123 */
123124 getOverlayState ?: ( ) => { hover : boolean } ;
125+ /**
126+ * 获取当前组件 popper 实例
127+ */
128+ getPopper ?: ( ) => Instance | null ;
124129 /**
125130 * 更新浮层内容
126131 */
Original file line number Diff line number Diff line change 1+ ---
2+ pr_number : 6096
3+ contributor : RSS1102
4+ ---
5+
6+ - feat(popup): 新增 ` getPopper() ` 方法,将返回 popper 实例,用于基于 popper 进行动态操作的场景 @RSS1102 ([ #6096 ] ( https://github.com/Tencent/tdesign-vue-next/pull/6096 ) )
You can’t perform that action at this time.
0 commit comments