t-select-option
SelectOption 选择项
组件介绍
t-select-option 是下拉选择的子级组件,用于定义下拉菜单中的选项,必须配合 t-select 使用。
平台兼容
| Harmony | H5 | Android | iOS | 小程序 | UTS |
|---|---|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
基础用法
基础用法参考 demo/select/select.uvue,作为 t-select 的子组件使用。
vue
<template>
<t-select v-model="selectedValue" placeholder="请选择">
<t-select-option value="1" label="选项一"></t-select-option>
<t-select-option value="2" label="选项二"></t-select-option>
<t-select-option value="3" label="选项三"></t-select-option>
</t-select>
</template>
<script setup>
const selectedValue = ref('')
</script>Props
| 属性名 | 说明 | 类型 | 默认值 |
|---|---|---|---|
value | 选项的值 | string | '' |
label | 选项的标签文本 | string | '' |
path | 点击组件后跳转的页面路径 | string | '' |
hover | 是否启用点击效果 | boolean | false |
type | 组件主题类型 | string | '' |
disabled | 是否禁用 | boolean | false |
effect | 组件显示主题 | string | '' |
size | 组件尺寸 | string | 'medium' |
Events
| 事件名 | 说明 | 回调参数 |
|---|---|---|
click | 点击时触发 | - |