feat(components): segmented组件新增block属性,可使其适合父元素宽度 (#997)

* feat: `segmented`组件新增`block`属性,可将宽度调整为父元素宽度
This commit is contained in:
Fifteen
2024-03-19 16:46:01 +08:00
committed by GitHub
parent 17d36f6b9a
commit bf128f183f
3 changed files with 61 additions and 2 deletions

View File

@@ -75,6 +75,26 @@ const optionsDisabled: Array<OptionsType> = [
}
];
/** block */
const optionsBlock: Array<OptionsType> = [
{
label: "周一"
},
{
label: "周二"
},
{
label: "周三"
},
{
label: "周四"
},
{
label: "周五喜悦,收尾归档,周末倒计时",
tip: "周五喜悦,收尾归档,周末倒计时"
}
];
/** 可设置图标 */
const optionsIcon: Array<OptionsType> = [
{
@@ -198,6 +218,9 @@ function onChange({ index, option }) {
<p class="mb-2">禁用</p>
<Segmented :options="optionsDisabled" />
<el-divider />
<p class="mb-2">block 属性(将宽度调整为父元素宽度)</p>
<Segmented :options="optionsBlock" block />
<el-divider />
<p class="mb-2">可设置图标</p>
<Segmented :options="optionsIcon" />
<el-divider />