ant-design-vue/components/segmented/demo/block.vue

34 lines
607 B
Vue
Raw Normal View History

2023-02-18 08:16:44 +00:00
<docs>
---
order: 1
title:
zh-CN: Block分段控制器
en-US: Block Segmented
---
## zh-CN
`block` 属性使其适合父元素宽度
## en-US
`block` property will make the `Segmented` fit to its parent width.
</docs>
<template>
2023-02-19 16:05:54 +00:00
<a-segmented v-model:value="value" block :options="data" />
2023-02-18 08:16:44 +00:00
</template>
<script lang="ts">
2023-02-19 16:05:54 +00:00
import { defineComponent, reactive, ref } from 'vue';
2023-02-18 08:16:44 +00:00
export default defineComponent({
setup() {
const data = reactive([123, 456, 'longtext-longtext-longtext-longtext']);
2023-02-19 16:05:54 +00:00
const value = ref(data[0]);
2023-02-18 08:16:44 +00:00
return {
data,
2023-02-19 16:05:54 +00:00
value,
2023-02-18 08:16:44 +00:00
};
},
});
</script>