Skip to content

Poster 海报卡片 · API 参考 ​

标签 <qtx-poster>;类型 java-bridge;事实层 TS 类型 / Vue SFC / Java 注解。使用说明与示例见组件文档。 本页由 npm run docs:gen 从源码自动生成,禁止手工编辑。

属性(Props · 30) ​

属性名类型必填默认值说明事实源
aspectRationumber否0.72卡片宽高比(宽 / 高),默认 0.72ts-types+vue-sfc+java
badgeRecord<string, any>否-角标数据(键值开放),默认空ts-types+vue-sfc+java
clickPayloadRecord<string, any>否-点击事件附带载荷(键值开放,随 click 事件回传),默认空ts-types+vue-sfc+java
coordRecord<string, any>否-坐标 / 布局附加参数(键值开放),默认空ts-types+vue-sfc+java
cornerRadiusnumber否12卡片圆角半径(px),默认 12ts-types+vue-sfc+java
elevationShadowboolean否false是否启用投影阴影,默认 falsets-types+vue-sfc+java
fallbackSrcstring否-主图加载失败时的兜底图地址,默认空ts-types+vue-sfc+java
floatSubtitlestring否-浮层副标题(text_float 版式专用),默认空ts-types+vue-sfc+java
floatTitlestring否-浮层标题(text_float 版式专用),默认空ts-types+vue-sfc+java
focusableboolean否true是否可获焦,默认 truets-types+vue-sfc+java
focusBorderboolean否true是否显示获焦描边,默认 truets-types+vue-sfc+java
focusGlowboolean否false是否显示获焦光晕,默认 falsets-types+vue-sfc+java
focusPayloadRecord<string, any>否-获焦事件附带载荷(键值开放,随 focus 事件回传),默认空ts-types+vue-sfc+java
focusScalenumber否1.05获焦缩放倍率,默认 1.05ts-types+vue-sfc+java
heightnumber | string否0卡片高度(数字自动补 px),默认 0ts-types
imagestring否-主图地址别名(优先级次于 poster),默认空ts-types+vue-sfc+java
imgUrlstring否-主图地址别名(优先级最低),默认空ts-types+vue-sfc+java
loadingDelayMsnumber否300加载态延迟显示毫秒数,默认 300ts-types+vue-sfc+java
localSrcstring否-本地图片资源(drawable / assets / file),默认空ts-types+vue-sfc+java
maxLinesnumber否1标题最大行数,默认 1ts-types+vue-sfc+java
placeholderColorstring否-占位图背景色,默认 #2E2E2Ets-types+vue-sfc+java
posterstring否-主图地址,三别名优先级 poster > image > imgUrl,默认空ts-types+vue-sfc+java
posterType'base' | 'text_bottom' | 'text_float' | string否base海报版式:base / text_bottom / text_float,默认 basets-types+vue-sfc+java
scaleTypestring否fitCenter图片缩放类型(如 fitCenter / centerCrop),默认 fitCenterts-types+vue-sfc+java
state'loading' | 'ready' | 'error' | string否loading卡片状态:loading / ready / error,默认 loadingts-types+vue-sfc+java
subtitlestring否-副标题文本,默认空ts-types+vue-sfc+java
textColorstring否-标题颜色,默认 #FFFFFFts-types+vue-sfc+java
textSizenumber否28标题字号,默认 28ts-types+vue-sfc+java
titlestring否-主标题文本,默认空ts-types+vue-sfc+java
widthnumber | string否0卡片宽度(数字自动补 px),默认 0ts-types

事件(Events · 24) ​

事件名载荷参数说明事实源
@badgeClickpayload: any-ts-types+vue-sfc
@bindpayload: any-ts-types+vue-sfc
@blurpayload: any-ts-types+vue-sfc
@clickpayload: any-ts-types+vue-sfc
@focuspayload: any-ts-types+vue-sfc
@imageLoadErrorpayload: any-ts-types+vue-sfc
@imageLoadStartpayload: any-ts-types+vue-sfc
@imageLoadSuccesspayload: any-ts-types+vue-sfc
@longClickpayload: any-ts-types+vue-sfc
@onBadgeClickpayload?: any角标被点击时触发vue-sfc+java
@onBindpayload?: any内容绑定到卡片时触发,用于生命周期取证vue-sfc+java
@onBlurpayload?: any卡片失去焦点时触发,载荷含 itemId / payloadvue-sfc+java
@onClickpayload?: any卡片被点击时触发,载荷含 itemId / position / payload / sourcevue-sfc+java
@onFocuspayload?: any卡片获得焦点时触发,载荷含 itemId / payloadvue-sfc+java
@onImageLoadErrorpayload?: any图源加载失败时触发,载荷含 source / kind / reason,可用于错误恢复vue-sfc+java
@onImageLoadStartpayload?: any图源开始加载时触发,载荷含 source / kindvue-sfc+java
@onImageLoadSuccesspayload?: any图源加载成功时触发,载荷含 source / kindvue-sfc+java
@onLongClickpayload?: any卡片长按时触发,可用于长按菜单vue-sfc+java
@onPatchpayload?: any局部刷新完成时触发,载荷含 patchKeysvue-sfc+java
@onRecyclepayload?: any卡片回收清理时触发vue-sfc+java
@onStateChangepayload?: any状态机迁移时触发,载荷含 from / tovue-sfc+java
@patchpayload: any-ts-types+vue-sfc
@recyclepayload: any-ts-types+vue-sfc
@stateChangepayload: any-ts-types+vue-sfc

方法(Methods / Expose · 15) ​

方法名参数返回值说明事实源
applyPatchpatch: 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
setAspectRatioratio: numbervoid设置卡片宽高比ts-types+vue-sfc+java
setBadgebadge: Record<string, any> | nullvoid设置或清除角标(传 null 清除)ts-types+vue-sfc+java
setImageSourcesource: string, kind?: stringvoid切换主图来源,kind 指定 local / network / asset 等ts-types+vue-sfc+java
setLoadingStateloading: booleanvoid显示 / 隐藏加载态ts-types+vue-sfc+java
setPosterTypetype: stringvoid切换海报版式ts-types+vue-sfc+java
setSubtitletext: stringvoid设置副标题文本ts-types+vue-sfc+java
setTitletext: stringvoid设置主标题文本ts-types+vue-sfc+java

插槽(Slots · 1) ​

插槽名说明事实源
default默认内容插槽,承载组件子内容js/qtx/src/components/QtxPoster/QtxPoster.vue

事实源 ​

  • js/qtx/src/components/QtxPoster/types.ts
  • js/qtx/src/components/QtxPoster/QtxPoster.vue
  • js/qtx/src/components/QtxPoster/QtxPosterBase.vue
  • android/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 声明。 同一属性多源存在时合并,说明取第一个非空值。若实现中存在本表未列出的方法,应补类型或注解,不应在文档中补写表格。

API 事实由源码自动生成 · 请勿手工编辑