Appearance
Poster 海报卡片 · API 参考
标签
<qtx-poster>;类型java-bridge;事实层 TS 类型 / Vue SFC / Java 注解。使用说明与示例见组件文档。 本页由npm run docs:gen从源码自动生成,禁止手工编辑。
属性(Props · 30)
| 属性名 | 类型 | 必填 | 默认值 | 说明 | 事实源 |
|---|---|---|---|---|---|
aspectRatio | number | 否 | 0.72 | 卡片宽高比(宽 / 高),默认 0.72 | ts-types+vue-sfc+java |
badge | Record<string, any> | 否 | - | 角标数据(键值开放),默认空 | ts-types+vue-sfc+java |
clickPayload | Record<string, any> | 否 | - | 点击事件附带载荷(键值开放,随 click 事件回传),默认空 | ts-types+vue-sfc+java |
coord | Record<string, any> | 否 | - | 坐标 / 布局附加参数(键值开放),默认空 | ts-types+vue-sfc+java |
cornerRadius | number | 否 | 12 | 卡片圆角半径(px),默认 12 | ts-types+vue-sfc+java |
elevationShadow | boolean | 否 | false | 是否启用投影阴影,默认 false | ts-types+vue-sfc+java |
fallbackSrc | string | 否 | - | 主图加载失败时的兜底图地址,默认空 | ts-types+vue-sfc+java |
floatSubtitle | string | 否 | - | 浮层副标题(text_float 版式专用),默认空 | ts-types+vue-sfc+java |
floatTitle | string | 否 | - | 浮层标题(text_float 版式专用),默认空 | ts-types+vue-sfc+java |
focusable | boolean | 否 | true | 是否可获焦,默认 true | ts-types+vue-sfc+java |
focusBorder | boolean | 否 | true | 是否显示获焦描边,默认 true | ts-types+vue-sfc+java |
focusGlow | boolean | 否 | false | 是否显示获焦光晕,默认 false | ts-types+vue-sfc+java |
focusPayload | Record<string, any> | 否 | - | 获焦事件附带载荷(键值开放,随 focus 事件回传),默认空 | ts-types+vue-sfc+java |
focusScale | number | 否 | 1.05 | 获焦缩放倍率,默认 1.05 | ts-types+vue-sfc+java |
height | number | string | 否 | 0 | 卡片高度(数字自动补 px),默认 0 | ts-types |
image | string | 否 | - | 主图地址别名(优先级次于 poster),默认空 | ts-types+vue-sfc+java |
imgUrl | string | 否 | - | 主图地址别名(优先级最低),默认空 | ts-types+vue-sfc+java |
loadingDelayMs | number | 否 | 300 | 加载态延迟显示毫秒数,默认 300 | ts-types+vue-sfc+java |
localSrc | string | 否 | - | 本地图片资源(drawable / assets / file),默认空 | ts-types+vue-sfc+java |
maxLines | number | 否 | 1 | 标题最大行数,默认 1 | ts-types+vue-sfc+java |
placeholderColor | string | 否 | - | 占位图背景色,默认 #2E2E2E | ts-types+vue-sfc+java |
poster | string | 否 | - | 主图地址,三别名优先级 poster > image > imgUrl,默认空 | ts-types+vue-sfc+java |
posterType | 'base' | 'text_bottom' | 'text_float' | string | 否 | base | 海报版式:base / text_bottom / text_float,默认 base | ts-types+vue-sfc+java |
scaleType | string | 否 | fitCenter | 图片缩放类型(如 fitCenter / centerCrop),默认 fitCenter | ts-types+vue-sfc+java |
state | 'loading' | 'ready' | 'error' | string | 否 | loading | 卡片状态:loading / ready / error,默认 loading | ts-types+vue-sfc+java |
subtitle | string | 否 | - | 副标题文本,默认空 | ts-types+vue-sfc+java |
textColor | string | 否 | - | 标题颜色,默认 #FFFFFF | ts-types+vue-sfc+java |
textSize | number | 否 | 28 | 标题字号,默认 28 | ts-types+vue-sfc+java |
title | string | 否 | - | 主标题文本,默认空 | ts-types+vue-sfc+java |
width | number | string | 否 | 0 | 卡片宽度(数字自动补 px),默认 0 | ts-types |
事件(Events · 24)
| 事件名 | 载荷参数 | 说明 | 事实源 |
|---|---|---|---|
@badgeClick | payload: any | - | ts-types+vue-sfc |
@bind | payload: any | - | ts-types+vue-sfc |
@blur | payload: any | - | ts-types+vue-sfc |
@click | payload: any | - | ts-types+vue-sfc |
@focus | payload: any | - | ts-types+vue-sfc |
@imageLoadError | payload: any | - | ts-types+vue-sfc |
@imageLoadStart | payload: any | - | ts-types+vue-sfc |
@imageLoadSuccess | payload: any | - | ts-types+vue-sfc |
@longClick | payload: any | - | ts-types+vue-sfc |
@onBadgeClick | payload?: any | 角标被点击时触发 | vue-sfc+java |
@onBind | payload?: any | 内容绑定到卡片时触发,用于生命周期取证 | vue-sfc+java |
@onBlur | payload?: any | 卡片失去焦点时触发,载荷含 itemId / payload | vue-sfc+java |
@onClick | payload?: any | 卡片被点击时触发,载荷含 itemId / position / payload / source | vue-sfc+java |
@onFocus | payload?: any | 卡片获得焦点时触发,载荷含 itemId / payload | vue-sfc+java |
@onImageLoadError | payload?: any | 图源加载失败时触发,载荷含 source / kind / reason,可用于错误恢复 | vue-sfc+java |
@onImageLoadStart | payload?: any | 图源开始加载时触发,载荷含 source / kind | vue-sfc+java |
@onImageLoadSuccess | payload?: any | 图源加载成功时触发,载荷含 source / kind | vue-sfc+java |
@onLongClick | payload?: any | 卡片长按时触发,可用于长按菜单 | vue-sfc+java |
@onPatch | payload?: any | 局部刷新完成时触发,载荷含 patchKeys | vue-sfc+java |
@onRecycle | payload?: any | 卡片回收清理时触发 | vue-sfc+java |
@onStateChange | payload?: any | 状态机迁移时触发,载荷含 from / to | vue-sfc+java |
@patch | payload: any | - | ts-types+vue-sfc |
@recycle | payload: any | - | ts-types+vue-sfc |
@stateChange | payload: any | - | ts-types+vue-sfc |
方法(Methods / Expose · 15)
| 方法名 | 参数 | 返回值 | 说明 | 事实源 |
|---|---|---|---|---|
applyPatch | patch: Record<string, any> | void | 局部增量更新(按 patch 键原位刷新,不重建) | ts-types+vue-sfc+java |
cancelImageLoad | — | void | 取消当前进行中的图片加载 | ts-types+vue-sfc+java |
clear | — | void | 清空卡片内容 | ts-types+vue-sfc+java |
getNativeNode | — | any | 取原生节点代理(Base→gate→$el,带 nodeId) | ts-types+vue-sfc |
getState | — | Promise<QtxPosterState> | 读取当前卡片状态快照 | ts-types+vue-sfc+java |
if | — | — | - | vue-sfc |
recycle | — | void | 回收并重置卡片(复用前调用) | ts-types+vue-sfc+java |
requestFocus | — | Promise<string> | 请求焦点,返回聚焦结果标识 | ts-types+vue-sfc+java |
setAspectRatio | ratio: number | void | 设置卡片宽高比 | ts-types+vue-sfc+java |
setBadge | badge: Record<string, any> | null | void | 设置或清除角标(传 null 清除) | ts-types+vue-sfc+java |
setImageSource | source: string, kind?: string | void | 切换主图来源,kind 指定 local / network / asset 等 | ts-types+vue-sfc+java |
setLoadingState | loading: boolean | void | 显示 / 隐藏加载态 | ts-types+vue-sfc+java |
setPosterType | type: string | void | 切换海报版式 | ts-types+vue-sfc+java |
setSubtitle | text: string | void | 设置副标题文本 | ts-types+vue-sfc+java |
setTitle | text: string | void | 设置主标题文本 | ts-types+vue-sfc+java |
插槽(Slots · 1)
| 插槽名 | 说明 | 事实源 |
|---|---|---|
default | 默认内容插槽,承载组件子内容 | js/qtx/src/components/QtxPoster/QtxPoster.vue |
事实源
js/qtx/src/components/QtxPoster/types.tsjs/qtx/src/components/QtxPoster/QtxPoster.vuejs/qtx/src/components/QtxPoster/QtxPosterBase.vueandroid/qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/card/QtxPosterController.java
java= Android@QtProp/@QtEvent/@QtMethod;ts-types=types.ts的 TSDoc;vue-sfc= SFC 内联defineProps/defineEmits/defineExpose;vue-options= Options API 的props声明。 同一属性多源存在时合并,说明取第一个非空值。若实现中存在本表未列出的方法,应补类型或注解,不应在文档中补写表格。