分段 Svelte 组件

包含以下组件:

按钮属性

按钮组件几乎具有与链接组件相同的属性,但有一些额外的按钮特定属性:

属性类型默认描述
<Segmented> 属性
raised布尔值false使分段提升
raisedIos布尔值false仅在 iOS 主题中使分段提升
raisedMd布尔值false仅在 MD 主题中使分段提升
round布尔值false使分段圆形
roundIos布尔值false仅在 iOS 主题中使分段圆形
roundMd布尔值false仅在 MD 主题中使分段圆形
strong布尔值false使分段强
strongIos布尔值false仅在 iOS 主题中使分段强
strongMd布尔值false仅在 MD 主题中使分段强
tag字符串div用于渲染分段元素的标签。可以是divp

示例

segmented.svelte
<script>
  import { Page, Navbar, Block, Segmented, Button } from 'framework7-svelte';

  let activeStrongButton = 0;
</script>

<!-- svelte-ignore a11y-invalid-attribute -->
<Page>
  <Navbar title="Segmented" />

  <Block strong outlineIos>
    <Segmented tag="p">
      <Button>Button</Button>
      <Button>Button</Button>
      <Button active>Active</Button>
    </Segmented>
    <Segmented strong tag="p">
      <Button active={activeStrongButton === 0} onClick={() => (activeStrongButton = 0)}
        >Button</Button
      >
      <Button active={activeStrongButton === 1} onClick={() => (activeStrongButton = 1)}
        >Button</Button
      >
      <Button active={activeStrongButton === 2} onClick={() => (activeStrongButton = 2)}
        >Button</Button
      >
    </Segmented>
    <Segmented raised tag="p">
      <Button>Button</Button>
      <Button>Button</Button>
      <Button active>Active</Button>
    </Segmented>
    <Segmented tag="p">
      <Button outline>Outline</Button>
      <Button outline>Outline</Button>
      <Button outline active>Active</Button>
    </Segmented>
    <Segmented raised round tag="p">
      <Button round>Button</Button>
      <Button round>Button</Button>
      <Button round active>Active</Button>
    </Segmented>
    <Segmented round tag="p">
      <Button round outline>Outline</Button>
      <Button round outline>Outline</Button>
      <Button round outline active>Active</Button>
    </Segmented>
  </Block>
</Page>
在本页上
无噪 Logo
无噪文档
中文文档 · 复刻官网
查看所有 ↗