Skip to content

AppIcon 应用图标卡片 · API 参考 ​

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

属性(Props · 37) ​

属性名类型必填默认值说明事实源
actionPayloadRecord<string, any>否-操作按钮事件附带载荷(键值开放,随 bannerAction 事件回传),默认空ts-types+vue-sfc+java
appLabelstring否-应用名称(等价于 title 的应用侧别名),默认空ts-types+vue-sfc+java
appTagstring否-应用标签(角标文案),默认空ts-types+vue-sfc+java
aspectRationumber否1卡片宽高比(宽 / 高),默认 1ts-types+vue-sfc+java
assetPathstring否-图标 assets 路径,默认空ts-types+vue-sfc+java
bannerRecord<string, any>否-banner 版式数据(键值开放),默认空ts-types+vue-sfc+java
buttonTextstring否-操作按钮文案,默认空ts-types+vue-sfc+java
clickPayloadRecord<string, any>否-点击事件附带载荷(键值开放,随 click 事件回传),默认空ts-types+vue-sfc+java
cornerRadiusnumber否12卡片圆角半径(px),默认 12ts-types+vue-sfc+java
fallbackIconstring否-图标解析 / 加载失败时的兜底图,默认空ts-types+vue-sfc+java
filePathstring否-图标文件路径(本地文件),默认空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
iconstring否-主图标地址,多来源别名之一(优先级 icon > image > imgUrl),默认空ts-types+vue-sfc+java
iconCornerRadiusnumber否12图标圆角半径(px),默认 12ts-types+vue-sfc+java
iconScaleTypestring否fitCenter图标缩放类型(如 fitCenter / centerCrop),默认 fitCenterts-types+vue-sfc+java
imagestring否-图标地址别名(优先级次于 icon),默认空ts-types+vue-sfc+java
imgUrlstring否-图标地址别名(优先级最低),默认空ts-types+vue-sfc+java
installStatestring否not_installed安装状态(如 not_installed / installing / installed),默认 not_installedts-types+vue-sfc+java
loadingDelayMsnumber否300加载态延迟显示毫秒数,默认 300ts-types+vue-sfc+java
localIconstring否-本地图标资源(drawable / assets / file),默认空ts-types+vue-sfc+java
packageNamestring否-应用包名(按已安装应用解析图标),默认空ts-types+vue-sfc+java
placeholderColorstring否-占位图背景色,默认 #2E2E2Ets-types+vue-sfc+java
pricestring否-应用价格文案,默认空ts-types+vue-sfc+java
progressnumber否0安装 / 下载进度(0-100),默认 0ts-types+vue-sfc+java
ratingnumber | string否0应用评分,默认 0ts-types+vue-sfc+java
resIdstring | number否-Android 资源 ID(R.drawable.xxx / 数字 id),默认空ts-types+vue-sfc+java
resNamestring否-Android 资源名(按名称解析 drawable),默认空ts-types+vue-sfc+java
spannumber否1网格跨列数,默认 1ts-types+vue-sfc+java
statestring否loading卡片状态,默认 loadingts-types+vue-sfc+java
titlestring否-卡片主标题,默认空ts-types+vue-sfc+java
variant'icon' | 'banner' | string否icon卡片版式:icon / banner,默认 iconts-types+vue-sfc+java
widthnumber | string否0卡片宽度(数字自动补 px),默认 0ts-types

事件(Events · 34) ​

事件名载荷参数说明事实源
@bannerActionpayload: 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
@iconLoadErrorpayload: any-ts-types+vue-sfc
@iconResolvedpayload: any-ts-types+vue-sfc
@imageLoadErrorpayload: any-ts-types+vue-sfc
@imageLoadStartpayload: any-ts-types+vue-sfc
@imageLoadSuccesspayload: any-ts-types+vue-sfc
@installStateChangepayload: any-ts-types+vue-sfc
@longClickpayload: any-ts-types+vue-sfc
@onBannerActionpayload?: anybanner 按钮点击时触发,载荷含 action / index / payloadvue-sfc+java
@onBindpayload?: any内容绑定时触发vue-sfc+java
@onBlurpayload?: any卡片失去焦点时触发vue-sfc+java
@onClickpayload?: any卡片被点击时触发,载荷含 itemId / position / payloadvue-sfc+java
@onFocuspayload?: any卡片获得焦点时触发vue-sfc+java
@onIconLoadErrorpayload?: any图标解析失败时触发,载荷含 source / kind / reason,应用未安装或资源缺失均会上抛vue-sfc+java
@onIconResolvedpayload?: any图标解析成功时触发,载荷含 source / kind / packageName / labelvue-sfc+java
@onImageLoadErrorpayload?: any图源加载失败时触发,载荷含 reasonvue-sfc+java
@onImageLoadStartpayload?: any图源开始加载时触发vue-sfc+java
@onImageLoadSuccesspayload?: any图源加载成功时触发vue-sfc+java
@onInstallStateChangepayload?: any安装状态变化时触发,载荷含 from / to / packageNamevue-sfc+java
@onLongClickpayload?: any卡片长按时触发vue-sfc+java
@onPatchpayload?: any局部刷新完成时触发,载荷含 patchKeysvue-sfc+java
@onProgressChangepayload?: any下载或安装进度刷新时触发,载荷含 progress / statevue-sfc+java
@onRecyclepayload?: any回收清理时触发vue-sfc+java
@onStateChangepayload?: any状态机迁移时触发,载荷含 from / tovue-sfc+java
@onVariantChangepayload?: any形态切换时触发,载荷含 from / tovue-sfc+java
@patchpayload: any-ts-types+vue-sfc
@progressChangepayload: any-ts-types+vue-sfc
@recyclepayload: any-ts-types+vue-sfc
@stateChangepayload: any-ts-types+vue-sfc
@variantChangepayload: any-ts-types+vue-sfc

方法(Methods / Expose · 18) ​

方法名参数返回值说明事实源
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
clearIconCachepackageName?: stringvoid清除图标缓存(传包名清指定应用,不传清全部)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
setAppIconpackageName: stringvoid按应用包名解析并切换应用图标ts-types+vue-sfc+java
setBannerDatabanner: Record<string, any>void设置 banner 版式数据ts-types+vue-sfc+java
setIconUrlurl: stringvoid切换为网络图标地址ts-types+vue-sfc+java
setInstallStatestate: stringvoid设置安装状态ts-types+vue-sfc+java
setLabeltext: stringvoid设置应用名称 / 主标题ts-types+vue-sfc+java
setLocalIconsrc: string, kind?: stringvoid切换为本地图标,kind 指定 drawable / assets / file 等ts-types+vue-sfc+java
setProgressprogress: numbervoid设置安装 / 下载进度(0-100)ts-types+vue-sfc+java
setRatingAndPricerating: string, price: stringvoid同时设置评分与价格文案ts-types+vue-sfc+java
setVariantvariant: stringvoid切换卡片版式(icon / banner)ts-types+vue-sfc+java

插槽(Slots · 1) ​

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

事实源 ​

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

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