TabPanel Tab panel
Register a panel, title and disabled state inside Tabs.
Import
Use <hui-tab-panel> with uni-app easycom. Import public types from @nscode/handy-uni. For ordinary Vue 3, install the preview plugin from @nscode/handy-uni/web and register its components.
Examples
Interact with the controls to see values and event results on the page.
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('No event yet')
const active = ref<string | number>('first')
const items = [
{ name: 'first', label: '概览 / Overview' },
{ name: 'second', label: '详情 / Details' }
]
</script>
Props
| Prop | Type | Default | Description |
|---|---|---|---|
name | string | number | — | Item identifier or registered icon name. |
lazyRender | boolean | undefined | Render content after its first activation or opening. |
Root attributes: common props. A Boolean default of undefined supports inheritance; explicit false overrides it. Other Boolean props default to false unless listed otherwise.
Events
None.
Slots
| Slot | Parameters | Description |
|---|---|---|
default | — | Main content. |
Methods
None.
Types
TabPanelProps are available from @nscode/handy-uni.
Platform notes
| Behavior | uni-app H5 | WeChat Mini Program | App-vue | Ordinary Vue 3 Web (preview) |
|---|---|---|---|---|
| Basic interaction | Supported; device checks pending | Supported; device checks pending | Supported; device checks pending | Supported by the web platform adapter |
Follow the smoke checklist. Device evidence is tracked separately; unit tests do not establish device acceptance.