翻譯進行中
本頁尚未翻譯為繁體中文,以下顯示簡體中文原文。範例的預設元件文字仍使用繁體中文。
TabPanel 标签面板
在 Tabs 中登记一个面板及其标题、禁用状态。
引入
uni-app 配置 easycom 后使用 <hui-tab-panel>;公开类型从 @nscode/handy-uni 导入。普通 Vue 3 项目安装 @nscode/handy-uni/web 预览版插件后使用同名组件。
示例
操作控件后,页面直接显示当前值和事件结果。
vue
<template>
<view>
<hui-tabs v-model="active" :items="items"
><hui-tab-panel name="first"><text>当前面板 / Current panel</text></hui-tab-panel
><hui-tab-panel name="second"><text>第二面板 / Second panel</text></hui-tab-panel></hui-tabs
>
<text>{{ lastEvent }}</text>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const lastEvent = ref('尚无事件')
const active = ref<string | number>('first')
const items = [
{ name: 'first', label: '概览 / Overview' },
{ name: 'second', label: '详情 / Details' }
]
</script>
Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
name | string | number | — | 项目标识或已登记图标名。 |
lazyRender | boolean | undefined | 面板第一次激活才渲染 |
根节点属性见通用属性。布尔默认值为 undefined 时支持继承;显式 false 会覆盖继承值。其他布尔值按表中默认值处理。
Events
无。
Slots
| 插槽 | 参数 | 说明 |
|---|---|---|
default | — | 主体内容。 |
方法
无。
类型
TabPanelProps 可从 @nscode/handy-uni 导入。
平台说明
| 行为 | uni-app H5 | 微信小程序 | App-vue | 普通 Vue 3 Web(预览) |
|---|---|---|---|---|
| 基本交互 | 已实现,待设备复核 | 已实现,待设备复核 | 已实现,待设备复核 | 由 Web 平台适配层实现 |
设备操作见冒烟清单。真实设备读数单独记录,单元测试通过不代表真机验收。