(component): [tab]新增 title 插槽

This commit is contained in:
sight
2022-06-29 16:23:13 +08:00
parent 36323688bb
commit a7076b66a5
5 changed files with 161 additions and 8 deletions

View File

@@ -36,6 +36,54 @@ export default {
:::
::: title 标题插槽
:::
::: demo
<template>
<lay-tab v-model="current11" :allow-close="true">
<lay-tab-item title="选项一" id="1">
<template #title>
<lay-icon type="layui-icon-console"></lay-icon>
<span style="margin-left:10px">选项一</span>
</template>
<div style="padding:20px">选项一</div>
</lay-tab-item>
<lay-tab-item title="选项一" id="2">
<template #title>
<lay-icon type="layui-icon-user"></lay-icon>
<span style="margin-left:10px">选项一</span>
</template>
<div style="padding:20px">选项二</div>
</lay-tab-item>
<lay-tab-item title="选项一" id="3">
<template #title>
<lay-icon type="layui-icon-set"></lay-icon>
<span style="margin-left:10px">选项一</span>
</template>
<div style="padding:20px">选项三</div>
</lay-tab-item>
</lay-tab>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const current11 = ref("1")
return {
current11
}
}
}
</script>
:::
::: title 简约模式
:::