Tooltip
WdBubble
Applicable Scenarios
Used to display tooltips.
Example
Display of Different Trigger Behaviors
Display of Different Pop-up Directions
Different Styles of Tooltips
Tooltip Delay Opening and Closing
Properties
External properties received by the component
Property Name | Property Identifier | Type | Description |
|---|
| 打开时延(毫秒) | openDelay | number | 气泡提示的打开时延(毫秒) |
| 关闭时延(毫秒) | closeDelay | number | 气泡提示的关闭时延(毫秒) Default value: 200 |
| 箭头是否指向中心 | arrowPointAtCenter | boolean | 气泡提示的箭头是否指向中心 |
| 触发行为 | trigger | string | 触发气泡提示的行为 Default value: "hover" |
| 弹出方向 | placement | string | 气泡提示的弹出方向 Default value: "top" |
| 气泡风格 | promptTheme | string | 气泡提示的风格 Default value: "default" |
Events
Events exposed by the component. You can listen to component events to trigger external actions
Event Name | Event Code | Event Output Parameters event.detail | Applicable Scenarios | Description |
|---|
| 打开气泡 | open | Web | - | |
| 关闭气泡 | close | Web | - |
Property API
Through the Property API, you can access the internal state and property values of components. You can access internal values using$w.componentId.propertyName, such as $w.input1.value. For details, please refer to Property API
Read-only Property Name | Property Identifier | Type | Description |
|---|
| 触发行为 | trigger | string | 触发气泡提示的行为 |
| 弹出方向 | placement | string | 气泡提示的弹出方向 |
| 气泡风格 | promptTheme | string | 气泡提示的风格 |
Method API
NoneStyle API
Through the Style API, you can override the styles of internal elements in components to achieve customization. For example, in the low-code editor, you can write styles for all button components using #wd-page-root .wd-btn, and control individual component styles with :scope. For detailed instructions, please refer toStyle API
Name | Class Name | Description and Examples |
|---|
| 根元素 | .wd-bubble | 气泡组件根元素 |
| 触发内容父元素 | .wd-bubble-child | 气泡插槽触发内容的父级元素,可以设置内容内部样式 |
| PC 端气泡根元素 | .wd-pc-bubble | 可以为 PC 端的气泡编写样式 |
| H5 端气泡根元素 | .wd-h5-bubble | 可以为 H5 端的气泡编写样式 |
| 气泡弹出层容器 | .wedatea2td-bubble | 可以为弹出的气泡设置样式,例如宽度,目前弹出的气泡最大宽度为 300px,可以设置max-width更改为其他宽度 |
CSS Variables
.wd-bubble {
// Tooltip top margin
--wd-bubble-top: 0px;
// Tooltip content left and right padding
--wd-bubble-inner-horizontal-padding: 12px;
// Tooltip content top and bottom padding
--wd-bubble-inner-vertical-padding: 8px;
// Tooltip content border-radius
--wd-divider-inner-border-radius: 3px;
}
Version Changes
None