分割条
QSeparator 组件用于分隔文本部分、其他组件等。它在父级的容器上创建一条水平的或垂直的彩色分割线。
QSeparator API
QSeparator API
props
6
content
3
style
3
spaced
: Boolean | String
说明
如果设置为true,则相应的方向边距将设置为8px;也可以设置为CSS单位中的大小,包括单位名称,或者其中一个预定义尺寸xs|sm|md|lg|xl
inset
: Boolean | String
说明
如果设置为布尔值 true,则左右边距将被设置为16px。如果设置为 'item',则会匹配 QItem 的设计。如果设置为 'item-thumbnail',则会匹配带有缩略图的 QItem 的设计
vertical
: Boolean
说明
如果设置为true,则分隔符将是垂直的。
用法
下面的示例只是演示,并不代表 QSeparator 只能用于 QCard, QList 或 QToolbar。
水平的
Template
<template>
<div class="q-pa-md">
<div class="q-gutter-md row items-start">
<q-card style="max-width: 250px">
<q-card-section>
<div class="text-h6">Our Changing Planet</div>
<div class="text-subtitle2">by John Doe</div>
</q-card-section>
<q-separator />
<q-card-actions>
<q-btn label="Share" color="primary" flat />
<q-btn label="Comment" color="secondary" flat />
</q-card-actions>
</q-card>
<q-list class="bg-grey-10 text-white shadow-2 rounded-borders" style="max-width: 250px; width: 100%;">
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar6.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Jane</q-item-section>
</q-item>
<q-separator dark />
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar3.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Lily</q-item-section>
</q-item>
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar5.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Mary</q-item-section>
</q-item>
</q-list>
</div>
</div>
</template>
Copied to clipboard
Our Changing Planet
by John Doe

Jane

Lily

Mary
水平且内嵌的
Template
<template>
<div class="q-pa-md">
<div class="q-gutter-md row items-start">
<q-card style="max-width: 250px">
<q-card-section>
<div class="text-h6">Our Changing Planet</div>
<div class="text-subtitle2">by John Doe</div>
</q-card-section>
<q-separator inset />
<q-card-section>
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
</q-card-section>
</q-card>
<q-list class="shadow-2 rounded-borders" style="max-width: 250px; width: 100%;">
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar6.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Jane</q-item-section>
</q-item>
<q-separator inset="item" />
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar3.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Lily</q-item-section>
</q-item>
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar5.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Mary</q-item-section>
</q-item>
</q-list>
<q-list class="shadow-2 rounded-borders" style="max-width: 250px; width: 100%;">
<q-item>
<q-item-section thumbnail>
<img src="https://cdn.quasar.dev/img/mountains.jpg">
</q-item-section>
<q-item-section>Mountains</q-item-section>
</q-item>
<q-separator inset="item-thumbnail" />
<q-item>
<q-item-section thumbnail>
<img src="https://cdn.quasar.dev/img/parallax1.jpg">
</q-item-section>
<q-item-section>Venice</q-item-section>
</q-item>
<q-item>
<q-item-section thumbnail>
<img src="https://cdn.quasar.dev/img/parallax2.jpg">
</q-item-section>
<q-item-section>The Bridge</q-item-section>
</q-item>
</q-list>
<q-list class="bg-grey-10 text-white shadow-2 rounded-borders" style="max-width: 250px; width: 100%;">
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar6.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Jane</q-item-section>
</q-item>
<q-separator inset dark />
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar3.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Lily</q-item-section>
</q-item>
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar5.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Mary</q-item-section>
</q-item>
</q-list>
</div>
</div>
</template>
Copied to clipboard
Our Changing Planet
by John Doe
Lorem ipsum dolor sit amet, consectetur adipisicing elit.

Jane

Lily

Mary

Mountains

Venice

The Bridge

Jane

Lily

Mary
垂直的
Template
<template>
<div class="q-pa-md">
<div class="q-gutter-y-md column">
<q-toolbar class="bg-grey-3 shadow-2 rounded-borders">
<q-btn flat round dense icon="menu" class="q-mr-sm" />
<q-separator vertical inset />
<q-btn stretch flat label="Link" />
<q-space />
<q-btn stretch flat label="Link" />
<q-separator vertical />
<q-btn stretch flat label="Link" />
<q-separator vertical />
<q-btn stretch flat label="Link" />
</q-toolbar>
<q-toolbar class="bg-primary text-white shadow-2 rounded-borders">
<q-btn flat round dense icon="menu" class="q-mr-sm" />
<q-separator dark vertical inset />
<q-btn stretch flat label="Link" />
<q-space />
<q-btn stretch flat label="Link" />
<q-separator dark vertical />
<q-btn stretch flat label="Link" />
<q-separator dark vertical />
<q-btn stretch flat label="Link" />
</q-toolbar>
</div>
</div>
</template>
Copied to clipboard
自定义颜色
Template
<template>
<div class="q-pa-md">
<q-list class="bg-grey-10 text-white shadow-2 rounded-borders" style="max-width: 250px; width: 100%;">
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar6.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Jane</q-item-section>
</q-item>
<q-separator color="orange" inset />
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar3.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Lily</q-item-section>
</q-item>
<q-item>
<q-item-section avatar>
<q-avatar>
<img src="https://cdn.quasar.dev/img/avatar5.jpg">
</q-avatar>
</q-item-section>
<q-item-section>Mary</q-item-section>
</q-item>
</q-list>
</div>
</template>
Copied to clipboard

Jane

Lily

Mary
着色 CSS 类
如果您需要,Quasar 提供了一些可用于 QSeparator 颜色的 CSS 类text-separator
, bg-separator
, text-dark-separator
, bg-dark-separator
。
版权声明 本中文文档内容版权为站长个人所有,保留所有权利。
免责声明 本站点所包含的任何跳转链接均为第三方广告内容,站点对这些广告内容的准确性、合法性、真实性不承担任何责任。用户点击跳转链接进入第三方网站后,应自行判断广告内容的真实性和合法性,并自行承担因使用广告内容而产生的风险和责任。任何因使用第三方广告内容而导致的损失或损害,本站点概不负责。