分段 Vue 组件
包含以下组件
f7-segmented
- 按钮的分段包装器
按钮属性
按钮组件具有与 链接 组件几乎相同的属性,但增加了一些按钮特定的属性
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
<f7-segmented> 属性 | |||
raised | 布尔 | false | 将分段升高 |
raised-ios | 布尔 | false | 仅在 iOS 主题中将分段升高 |
raised-md | 布尔 | false | 仅在 MD 主题中将分段升高 |
round | 布尔 | false | 将分段设为圆形 |
round-ios | 布尔 | false | 仅在 iOS 主题中将分段设为圆形 |
round-md | 布尔 | false | 仅在 MD 主题中将分段设为圆形 |
strong | 布尔 | false | 将分段加粗 |
strong-ios | 布尔 | false | 仅在 iOS 主题中制作强分段 |
strong-md | 布尔 | false | 仅在 MD 主题中制作强分段 |
tag | string | div | 用于渲染分段元素的标签 |
示例
segmented.vue
<template>
<f7-page>
<f7-navbar title="Segmented"></f7-navbar>
<f7-block strong outline-ios>
<f7-segmented tag="p">
<f7-button>Button</f7-button>
<f7-button>Button</f7-button>
<f7-button active>Active</f7-button>
</f7-segmented>
<f7-segmented strong tag="p">
<f7-button :active="activeStrongButton === 0" @click="activeStrongButton = 0"
>Button</f7-button
>
<f7-button :active="activeStrongButton === 1" @click="activeStrongButton = 1"
>Button</f7-button
>
<f7-button :active="activeStrongButton === 2" @click="activeStrongButton = 2"
>Button</f7-button
>
</f7-segmented>
<f7-segmented raised tag="p">
<f7-button>Button</f7-button>
<f7-button>Button</f7-button>
<f7-button active>Active</f7-button>
</f7-segmented>
<f7-segmented tag="p">
<f7-button outline>Outline</f7-button>
<f7-button outline>Outline</f7-button>
<f7-button outline active>Active</f7-button>
</f7-segmented>
<f7-segmented raised round tag="p">
<f7-button round>Button</f7-button>
<f7-button round>Button</f7-button>
<f7-button round active>Active</f7-button>
</f7-segmented>
<f7-segmented round tag="p">
<f7-button round outline>Outline</f7-button>
<f7-button round outline>Outline</f7-button>
<f7-button round outline active>Active</f7-button>
</f7-segmented>
</f7-block>
</f7-page>
</template>
<script>
import { ref } from 'vue';
import { f7Navbar, f7Page, f7Block, f7Button, f7Segmented } from 'framework7-vue';
export default {
components: {
f7Navbar,
f7Page,
f7Block,
f7Button,
f7Segmented,
},
setup() {
const activeStrongButton = ref(0);
return {
activeStrongButton,
};
},
};
</script>