工具提示

尝试一下

w-lang.hover-target(key="hoverOnMe" tooltips="tooltipsContent")
.hover-target
	display flex
	justify-content center
	align-items center
	max-width 150px
	max-height 70px
	width 80%
	height 80%
	border-radius 4px
	background var(--w-btn-bg)

HTML 属性

在 HTML 中使用 tooltips 属性可为对应元素设置工具提示,但仅限于 DOMContentLoaded 事件触发前添加到 DOM 树的元素。

div(tooltips="locale.key.here")

接口

tooltips

import { tooltips } from 'abm-ui';

get()

获取元素对应的工具提示内容。

参数:

返回值:DOMContents | undefined

set()

为元素设置工具提示。

参数:

lock()

锁定工具提示,锁定后工具提示将始终显示。

参数:

unlock()

解锁工具提示。