Appearance
ChannelNav 频道导航 · API 参考
标签
<qtx-channel-nav>;类型java-bridge;事实层 TS 类型 / Vue SFC / Java 注解。使用说明与示例见组件文档。 本页由npm run docs:gen从源码自动生成,禁止手工编辑。
属性(Props · 51)
| 属性名 | 类型 | 必填 | 默认值 | 说明 | 事实源 |
|---|---|---|---|---|---|
active | string | 否 | `` | 当前选中频道 key,默认 '';受控属性,组件不自行修改 | ts-types+vue-sfc+java |
align | 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly' | string | 否 | center | 频道序列在整栏内的主轴对齐;横排=水平轴、竖排=垂直轴,默认 center | ts-types+vue-sfc+java |
badgeBg | string | 否 | #E5484D | 角标底色,默认 #E5484D | ts-types+vue-sfc+java |
badgeText | string | 否 | #FFFFFF | 角标文字色,默认 #FFFFFF | ts-types+vue-sfc+java |
borderRadius | number | 否 | 36 | 单项圆角(px),默认 36;配合白色焦点底形成胶囊 | ts-types+vue-sfc+java |
crossAlign | 'start' | 'center' | 'end' | string | 否 | center | 频道项在整栏内的交叉轴对齐;横排=垂直轴、竖排=水平轴,默认 center | ts-types+vue-sfc+java |
defaultFocusKey | string | 否 | `` | 首次进入时默认获焦的频道 key,默认 ''(回退到当前 active) | ts-types+vue-sfc+java |
disableBackToInitial | boolean | 否 | false | 关闭「返回先归位」:默认开启归位,写该属性则按返回直接交给页面处理 | ts-types+vue-sfc+java |
disableBackToTop | boolean | 否 | false | 关闭三段式返回的第①段(列表滚离顶部时先回顶);默认开启。关闭后按返回直接进入频道归位 | ts-types+vue-sfc+java |
disabledBg | string | 否 | #00000000 | 禁用项底色,默认透明 #00000000 | ts-types+vue-sfc+java |
disabledText | string | 否 | #5A6675 | 禁用项文字色,默认 #5A6675 | ts-types+vue-sfc+java |
focusable | boolean | 否 | true | 频道项是否可获焦,默认 true;关闭后只展示不参与遥控器焦点 | ts-types+vue-sfc+java |
focusBg | string | 否 | #FFFFFF | 获焦态底色,默认白色圆角胶囊 #FFFFFF | ts-types+vue-sfc+java |
focusBorderColor | string | 否 | #FFFFFF | 焦点描边颜色,默认 #FFFFFF;仅 focusBorderWidth 大于 0 时生效 | ts-types+vue-sfc+java |
focusBorderWidth | number | 否 | 0 | 焦点描边宽度(px),默认 0;白色焦点底已是强指示,需要描边时调大 | ts-types+vue-sfc+java |
focusedKey | string | 否 | '' | 受控焦点频道 key;ES 把方向键派发给页面 onKeyDown,由上层回写此属性驱动焦点态 | ts-types+vue-sfc+java |
focusMemory | boolean | 否 | true | 数据更新后恢复之前的焦点项,默认 true,避免写操作后丢焦点 | ts-types+vue-sfc+java |
focusText | string | 否 | #141922 | 获焦态文字色,默认近黑 #141922 | ts-types+vue-sfc+java |
focusWithin | boolean | 否 | true | 焦点是否属于频道栏;传 false 时清除焦点态(白色胶囊消失、选中项保持纯白文字)并忽略方向键与受控 focusedKey,避免内容区左右键误切 Tab。默认 true | ts-types+vue-sfc+java |
fontSize | number | 否 | 28 | 频道文字默认粗体;字号(px),默认 28 | ts-types+vue-sfc+java |
gap | number | 否 | 24 | 项间距(px),默认 24 | ts-types+vue-sfc+java |
gravity | 'start' | 'center' | 'end' | string | 否 | center | 图标与文字组成的整组内容在项内对齐 start / center / end,默认 center(不移动频道序列) | ts-types+vue-sfc+java |
height | number | string | 否 | - | 整栏高度(px);显式声明可避免宿主布局把容器压成 0,也是 crossAlign 计算的基准 | ts-types |
iconMargin | number | 否 | 16 | 图标与频道文字之间的间距(px),随 iconPosition 作用于对应方向,默认 16 | ts-types+vue-sfc+java |
iconPosition | 'left' | 'top' | 'right' | 'bottom' | string | 否 | left | 图标相对文字的位置 left / top / right / bottom,默认 left | ts-types+vue-sfc+java |
iconSize | number | 否 | 32 | 图标尺寸(px),默认 32;设为 0 隐藏图标 | ts-types+vue-sfc+java |
indicator | 'none' | 'underline' | 'bar' | string | 否 | none | 选中指示器 none / underline / bar,默认 none | ts-types+vue-sfc+java |
indicatorColor | string | 否 | #FFFFFF | 选中指示器颜色,默认 #FFFFFF | ts-types+vue-sfc+java |
indicatorSize | number | 否 | 6 | 选中指示器厚度(px),默认 6 | ts-types+vue-sfc+java |
initialActiveKey | string | 否 | '' | 初始选中位置(频道 key);在频道栏上按返回时若当前不在该位置,先回到这里。留空时自动记首次生效的 active | ts-types+vue-sfc+java |
initialFocusKey | string | 否 | '' | 初始焦点位置(频道 key);优先于 defaultFocusKey,留空时回退到 defaultFocusKey / active | ts-types+vue-sfc+java |
itemHeight | number | 否 | 72 | 单项高度(px),默认 72 | ts-types+vue-sfc+java |
itemPadding | number | 否 | 16 | 频道项内容区内边距(px),四边统一;避免图标/文字贴着 item 边缘,默认 16 | ts-types+vue-sfc+java |
items | QtxChannelNavItem[] | 否 | [] | 频道数据,默认 [];数组顺序即遥控器遍历顺序 | ts-types+vue-sfc+java |
itemWidth | number | 否 | 240 | 单项宽度(px),默认 240;按「图标 + 4~6 字频道名」给出,不写也不会截断 | ts-types+vue-sfc+java |
linkId | string | 否 | '' | 与 qtx-tabs 建立底层联动的关系标识,两边写同名即成组;建立关系后焦点移动由 native 直接驱动 tab 切换再通知上层。焦点即切由关系本身提供,selectOnFocus 仅作用于独立频道栏 | ts-types+vue-sfc+java |
maxPoolSize | number | 否 | 16 | 复用池容量上限(1~128),默认 16;长列表调大可减少创建次数 | ts-types+vue-sfc+java |
normalBg | string | 否 | #00000000 | 普通态底色,默认透明 #00000000 | ts-types+vue-sfc+java |
normalText | string | 否 | #C2CAD4 | 普通态文字色,默认非纯白的灰白 #C2CAD4 | ts-types+vue-sfc+java |
orientation | 'horizontal' | 'vertical' | string | 否 | horizontal | 布局方向,默认 horizontal(顶部横排),vertical 为左侧竖排 | ts-types+vue-sfc+java |
paddingBottom | number | 否 | 0 | 栏内下内边距(px),默认 0 | ts-types+vue-sfc+java |
paddingLeft | number | 否 | 0 | 栏内左内边距(px),默认 0 | ts-types+vue-sfc+java |
paddingRight | number | 否 | 0 | 栏内右内边距(px),默认 0 | ts-types+vue-sfc+java |
paddingTop | number | 否 | 0 | 栏内上内边距(px),默认 0 | ts-types+vue-sfc+java |
reverseLayout | boolean | 否 | false | 反转排列方向:横排从右往左、竖排从下往上,默认 false | ts-types+vue-sfc+java |
scrollMode | 'center' | 'edge' | 'none' | string | 否 | center | 滚动策略 center / edge / none,默认 center(焦点项自动居中) | ts-types+vue-sfc+java |
selectedBg | string | 否 | #00000000 | 选中态底色,默认透明 #00000000;选中只提亮文字,不靠色块 | ts-types+vue-sfc+java |
selectedText | string | 否 | #FFFFFF | 选中态文字色,默认纯白 #FFFFFF | ts-types+vue-sfc+java |
selectOnFocus | boolean | 否 | false | 焦点移动即切换选中频道,默认 false;开启后仍派发 change | ts-types+vue-sfc+java |
smoothScroll | boolean | 否 | true | 命令式滚动是否使用平滑动画,默认 true | ts-types+vue-sfc+java |
width | number | string | 否 | - | 整栏宽度(px);显式声明可避免宿主布局把容器压成 0,也是 align 计算的基准 | ts-types |
事件(Events · 11)
| 事件名 | 载荷参数 | 说明 | 事实源 |
|---|---|---|---|
@blur | key: string, payload: QtxChannelNavEventPayload | - | vue-sfc |
@change | key: string, payload: QtxChannelNavEventPayload | - | ts-types+vue-sfc |
@focus | key: string, payload: QtxChannelNavEventPayload | - | vue-sfc |
@longClick | key: string, payload: QtxChannelNavEventPayload | - | vue-sfc |
@onBlur | payload?: any | 焦点离开某个频道时触发;载荷含 key / position | vue-sfc+java |
@onChange | payload?: any | 确认某个频道时触发;载荷含 key / position / previous / item,组件不自行修改受控 active | vue-sfc+java |
@onFocus | payload?: any | 遥控器焦点落到某个频道时触发;载荷含 key / position / item | vue-sfc+java |
@onLongClick | payload?: any | 长按某个频道时触发;载荷含 key / position / item | vue-sfc+java |
@onScroll | payload?: any | 首个可见项变化时触发;载荷含 first / last,便于业务统计曝光 | vue-sfc+java |
@scroll | payload: QtxChannelNavScrollPayload | - | vue-sfc |
@update:active | key: string | - | vue-sfc |
方法(Methods / Expose · 18)
| 方法名 | 参数 | 返回值 | 说明 | 事实源 |
|---|---|---|---|---|
clearFocus | — | Promise<string> | 清除频道栏焦点与焦点态 | ts-types+vue-sfc+java |
focusBack | — | — | - | vue-sfc+java |
getActiveKey | — | Promise<string> | 读取当前选中频道 key | ts-types+vue-sfc+java |
getFocusedKey | — | Promise<string> | 读取当前获焦频道 key | ts-types+vue-sfc+java |
getInitialActiveKey | — | Promise<string> | 读取初始选中位置(频道 key) | ts-types+vue-sfc+java |
getItemAt | index: number | Promise<QtxChannelNavItem> | 按位置读取单个频道项 | ts-types+vue-sfc+java |
getItemCount | — | Promise<number> | 读取频道总数 | ts-types+vue-sfc+java |
getNativeNode | — | any | 取到底层原生节点,供高级场景直接调用 | ts-types+vue-sfc |
getScrollState | — | Promise<QtxChannelNavState> | 读取可见区间与滚动状态快照 | ts-types+vue-sfc+java |
getState | — | Promise<QtxChannelNavState> | 读取完整状态快照 | ts-types+vue-sfc+java |
handleBack | — | boolean | 三段式返回(同步,页面 onBackPressed 必须调用):焦点先回频道栏再把列表滚回顶部 → 频道归位 → 交还页面;返回本次是否消费 | ts-types+vue-sfc+java |
if | — | — | - | vue-sfc |
requestFocus | — | Promise<string> | 把遥控器焦点请求到当前选中频道 | ts-types+vue-sfc+java |
scrollToKey | key: string | Promise<string> | 滚动到指定频道 key | ts-types+vue-sfc+java |
setActive | key: string | void | 命令式设置选中频道,并回传 change 供上层同步受控值 | ts-types+vue-sfc+java |
setOrientation | orientation: 'horizontal' | 'vertical' | string | Promise<string> | 运行时切换横竖方向,内部清池并重建布局 | ts-types+vue-sfc+java |
setStyle | tokens: Partial<QtxChannelNavProps> | Promise<string> | 批量覆盖视觉 token,避免逐个 prop 触发多次刷新 | ts-types+vue-sfc+java |
updateItems | items: QtxChannelNavItem[] | Promise<string> | 差量更新频道数据;key 序列不变时只刷新内容变化的项 | ts-types+vue-sfc+java |
插槽(Slots · 2)
| 插槽名 | 说明 | 事实源 |
|---|---|---|
default | 默认内容插槽,承载组件子内容 | js/qtx/src/components/QtxChannelNav/QtxChannelNav.vue |
item | 列表行模板插槽,作用域参数包含 item / index | docs-site/components/qtx-channel-nav/examples/nav-tabs-link.vue |
事实源
js/qtx/src/components/QtxChannelNav/types.tsjs/qtx/src/components/QtxChannelNav/QtxChannelNav.vuejs/qtx/src/components/QtxChannelNav/QtxChannelNavBase.vueandroid/qtx-portal-bridge/src/main/java/com/quicktvui/qtx/portal/channelnav/QtxChannelNavController.java
java= Android@QtProp/@QtEvent/@QtMethod;ts-types=types.ts的 TSDoc;vue-sfc= SFC 内联defineProps/defineEmits/defineExpose;vue-options= Options API 的props声明。 同一属性多源存在时合并,说明取第一个非空值。若实现中存在本表未列出的方法,应补类型或注解,不应在文档中补写表格。