<tap-code-block>

用于展示带语法高亮的代码片段,支持行号、行高亮和范围选择,以聚焦代码的特定部分。

Example

API

TapCodeBlockElement

Shadow DOM; Extends TapVisibleBaseElement

TapCodeBlockElement Instance Properties

Property(Attribute) Reactive Type
codelang(codelang) Yes string
range(range) Yes string
highlight(highlight) Yes string

TapVisibleBaseElement

Extends GemElement

TapVisibleBaseElement Instance Properties

Property(Attribute) Reactive Type Description
show Emitter
hide Emitter
fullShow Emitter Fired when the element becomes visible and entirely within the viewport,
e.g. a page whose enter animation has finished.
intersectionRoot Yes Element | Document
intersectionRootMargin Yes string
trackVisibility(track-visibility) Yes boolean
delay(delay) Yes number

TapVisibleBaseElement Other

Type Value
Event show, hide, full-show
CSS State visible, full-visible