Appearance
AppIcon 应用图标卡片 · API 参考
标签
<qtx-app-icon>;类型java-bridge;事实层 TS 类型 / Vue SFC / Java 注解。使用说明与示例见组件文档。 本页由npm run docs:gen从源码自动生成,禁止手工编辑。
属性(Props · 37)
| 属性名 | 类型 | 必填 | 默认值 | 说明 | 事实源 |
|---|---|---|---|---|---|
actionPayload | Record<string, any> | 否 | - | 操作按钮事件附带载荷(键值开放,随 bannerAction 事件回传),默认空 | ts-types+vue-sfc+java |
appLabel | string | 否 | - | 应用名称(等价于 title 的应用侧别名),默认空 | ts-types+vue-sfc+java |
appTag | string | 否 | - | 应用标签(角标文案),默认空 | ts-types+vue-sfc+java |
aspectRatio | number | 否 | 1 | 卡片宽高比(宽 / 高),默认 1 | ts-types+vue-sfc+java |
assetPath | string | 否 | - | 图标 assets 路径,默认空 | ts-types+vue-sfc+java |
banner | Record<string, any> | 否 | - | banner 版式数据(键值开放),默认空 | ts-types+vue-sfc+java |
buttonText | string | 否 | - | 操作按钮文案,默认空 | ts-types+vue-sfc+java |
clickPayload | Record<string, any> | 否 | - | 点击事件附带载荷(键值开放,随 click 事件回传),默认空 | ts-types+vue-sfc+java |
cornerRadius | number | 否 | 12 | 卡片圆角半径(px),默认 12 | ts-types+vue-sfc+java |
fallbackIcon | string | 否 | - | 图标解析 / 加载失败时的兜底图,默认空 | ts-types+vue-sfc+java |
filePath | string | 否 | - | 图标文件路径(本地文件),默认空 | 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 |
icon | string | 否 | - | 主图标地址,多来源别名之一(优先级 icon > image > imgUrl),默认空 | ts-types+vue-sfc+java |
iconCornerRadius | number | 否 | 12 | 图标圆角半径(px),默认 12 | ts-types+vue-sfc+java |
iconScaleType | string | 否 | fitCenter | 图标缩放类型(如 fitCenter / centerCrop),默认 fitCenter | ts-types+vue-sfc+java |
image | string | 否 | - | 图标地址别名(优先级次于 icon),默认空 | ts-types+vue-sfc+java |
imgUrl | string | 否 | - | 图标地址别名(优先级最低),默认空 | ts-types+vue-sfc+java |
installState | string | 否 | not_installed | 安装状态(如 not_installed / installing / installed),默认 not_installed | ts-types+vue-sfc+java |
loadingDelayMs | number | 否 | 300 | 加载态延迟显示毫秒数,默认 300 | ts-types+vue-sfc+java |
localIcon | string | 否 | - | 本地图标资源(drawable / assets / file),默认空 | ts-types+vue-sfc+java |
packageName | string | 否 | - | 应用包名(按已安装应用解析图标),默认空 | ts-types+vue-sfc+java |
placeholderColor | string | 否 | - | 占位图背景色,默认 #2E2E2E | ts-types+vue-sfc+java |
price | string | 否 | - | 应用价格文案,默认空 | ts-types+vue-sfc+java |
progress | number | 否 | 0 | 安装 / 下载进度(0-100),默认 0 | ts-types+vue-sfc+java |
rating | number | string | 否 | 0 | 应用评分,默认 0 | ts-types+vue-sfc+java |
resId | string | number | 否 | - | Android 资源 ID(R.drawable.xxx / 数字 id),默认空 | ts-types+vue-sfc+java |
resName | string | 否 | - | Android 资源名(按名称解析 drawable),默认空 | ts-types+vue-sfc+java |
span | number | 否 | 1 | 网格跨列数,默认 1 | ts-types+vue-sfc+java |
state | string | 否 | loading | 卡片状态,默认 loading | ts-types+vue-sfc+java |
title | string | 否 | - | 卡片主标题,默认空 | ts-types+vue-sfc+java |
variant | 'icon' | 'banner' | string | 否 | icon | 卡片版式:icon / banner,默认 icon | ts-types+vue-sfc+java |
width | number | string | 否 | 0 | 卡片宽度(数字自动补 px),默认 0 | ts-types |
事件(Events · 34)
| 事件名 | 载荷参数 | 说明 | 事实源 |
|---|---|---|---|
@bannerAction | 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 |
@iconLoadError | payload: any | - | ts-types+vue-sfc |
@iconResolved | 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 |
@installStateChange | payload: any | - | ts-types+vue-sfc |
@longClick | payload: any | - | ts-types+vue-sfc |
@onBannerAction | payload?: any | banner 按钮点击时触发,载荷含 action / index / payload | vue-sfc+java |
@onBind | payload?: any | 内容绑定时触发 | vue-sfc+java |
@onBlur | payload?: any | 卡片失去焦点时触发 | vue-sfc+java |
@onClick | payload?: any | 卡片被点击时触发,载荷含 itemId / position / payload | vue-sfc+java |
@onFocus | payload?: any | 卡片获得焦点时触发 | vue-sfc+java |
@onIconLoadError | payload?: any | 图标解析失败时触发,载荷含 source / kind / reason,应用未安装或资源缺失均会上抛 | vue-sfc+java |
@onIconResolved | payload?: any | 图标解析成功时触发,载荷含 source / kind / packageName / label | vue-sfc+java |
@onImageLoadError | payload?: any | 图源加载失败时触发,载荷含 reason | vue-sfc+java |
@onImageLoadStart | payload?: any | 图源开始加载时触发 | vue-sfc+java |
@onImageLoadSuccess | payload?: any | 图源加载成功时触发 | vue-sfc+java |
@onInstallStateChange | payload?: any | 安装状态变化时触发,载荷含 from / to / packageName | vue-sfc+java |
@onLongClick | payload?: any | 卡片长按时触发 | vue-sfc+java |
@onPatch | payload?: any | 局部刷新完成时触发,载荷含 patchKeys | vue-sfc+java |
@onProgressChange | payload?: any | 下载或安装进度刷新时触发,载荷含 progress / state | vue-sfc+java |
@onRecycle | payload?: any | 回收清理时触发 | vue-sfc+java |
@onStateChange | payload?: any | 状态机迁移时触发,载荷含 from / to | vue-sfc+java |
@onVariantChange | payload?: any | 形态切换时触发,载荷含 from / to | vue-sfc+java |
@patch | payload: any | - | ts-types+vue-sfc |
@progressChange | payload: any | - | ts-types+vue-sfc |
@recycle | payload: any | - | ts-types+vue-sfc |
@stateChange | payload: any | - | ts-types+vue-sfc |
@variantChange | payload: any | - | ts-types+vue-sfc |
方法(Methods / Expose · 18)
| 方法名 | 参数 | 返回值 | 说明 | 事实源 |
|---|---|---|---|---|
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 |
clearIconCache | packageName?: string | void | 清除图标缓存(传包名清指定应用,不传清全部) | ts-types+vue-sfc+java |
getNativeNode | — | any | 取原生节点代理(Base→gate→$el,带 nodeId) | ts-types+vue-sfc |
getState | — | Promise<QtxAppIconState> | 读取当前卡片状态快照 | ts-types+vue-sfc+java |
if | — | — | - | vue-sfc |
recycle | — | void | 回收并重置卡片(复用前调用) | ts-types+vue-sfc+java |
requestFocus | — | Promise<string> | 请求焦点,返回聚焦结果标识 | ts-types+vue-sfc+java |
setAppIcon | packageName: string | void | 按应用包名解析并切换应用图标 | ts-types+vue-sfc+java |
setBannerData | banner: Record<string, any> | void | 设置 banner 版式数据 | ts-types+vue-sfc+java |
setIconUrl | url: string | void | 切换为网络图标地址 | ts-types+vue-sfc+java |
setInstallState | state: string | void | 设置安装状态 | ts-types+vue-sfc+java |
setLabel | text: string | void | 设置应用名称 / 主标题 | ts-types+vue-sfc+java |
setLocalIcon | src: string, kind?: string | void | 切换为本地图标,kind 指定 drawable / assets / file 等 | ts-types+vue-sfc+java |
setProgress | progress: number | void | 设置安装 / 下载进度(0-100) | ts-types+vue-sfc+java |
setRatingAndPrice | rating: string, price: string | void | 同时设置评分与价格文案 | ts-types+vue-sfc+java |
setVariant | variant: string | void | 切换卡片版式(icon / banner) | ts-types+vue-sfc+java |
插槽(Slots · 1)
| 插槽名 | 说明 | 事实源 |
|---|---|---|
default | 默认内容插槽,承载组件子内容 | js/qtx/src/components/QtxAppIcon/QtxAppIcon.vue |
事实源
js/qtx/src/components/QtxAppIcon/types.tsjs/qtx/src/components/QtxAppIcon/QtxAppIcon.vuejs/qtx/src/components/QtxAppIcon/QtxAppIconBase.vueandroid/qtx-glint-items/src/main/java/com/quicktvui/qtx/glint/card/QtxAppIconController.java
java= Android@QtProp/@QtEvent/@QtMethod;ts-types=types.ts的 TSDoc;vue-sfc= SFC 内联defineProps/defineEmits/defineExpose;vue-options= Options API 的props声明。 同一属性多源存在时合并,说明取第一个非空值。若实现中存在本表未列出的方法,应补类型或注解,不应在文档中补写表格。