Skip to content

Panel 通用面板

AuPanel 只提供材质表面、边框、深度、尺寸、滚动能力和三个渲染插槽,不定义标题、状态、菜单或业务数据结构。用户可以在插槽中组合任意 Vue 内容。

基础用法

完全由插槽渲染的面板

标题、说明、操作和反馈均由使用者提供,Panel 不解析任何业务字段。

WORKSPACE

工作区设置

界面、通知与成员偏好

vue
<template>
  <AuPanel width="368px" depth="overlay" aria-label="工作区选项">
    <template #header>
      <div class="panel-demo__header">
        <span class="panel-demo__eyebrow">WORKSPACE</span>
        <h3>工作区设置</h3>
        <p>界面、通知与成员偏好</p>
      </div>
    </template>
    <AuMenuList :divided="false" :elevated="false" aria-label="工作区设置菜单">
      <AuMenuListItem
        title="界面偏好"
        description="调整主题与内容密度"
        :leading-icon="IconAdjustmentsHorizontal"
        leading-variant="tinted"
        accessory="chevron"
        clickable
        @click="lastAction = '界面偏好'"
      />
      <AuMenuListItem
        title="成员管理"
        description="查看成员与访问权限"
        :leading-icon="IconUsers"
        leading-variant="tinted"
        accessory="chevron"
        clickable
        @click="lastAction = '成员管理'"
      />
    </AuMenuList>
    <template #footer>
      <span class="panel-demo__result">最近操作:{{ lastAction || '尚未选择' }}</span>
    </template>
  </AuPanel>
</template>
<script setup>
import { ref } from 'vue';
import {
  AuMenuList,
  AuMenuListItem,
  AuPanel,
  IconAdjustmentsHorizontal,
  IconUsers,
} from 'aurora-plus';
const lastAction = ref('');
</script>
<style scoped>
.panel-demo__header {
  display: grid;
  gap: 5px;
}
.panel-demo__eyebrow {
  color: var(--au-color-primary);
  font-size: var(--au-font-size-small);
  font-weight: var(--au-font-weight-semibold);
  letter-spacing: 0.09em;
}
.panel-demo__header h3,
.panel-demo__header p {
  margin: 0;
}
.panel-demo__header h3 {
  margin-top: 10px;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.panel-demo__header p,
.panel-demo__result {
  color: var(--au-color-text-secondary);
  font-size: var(--au-font-size-small);
}
</style>

设计边界

  • headerdefaultfooter 只提供区域位置,不生成标题或按钮。
  • 普通静态内容容器使用 AuCard;需要明确头部、主体、尾部和主体滚动时使用 AuPanel
  • 锚定触发器显示时,在外层使用 AuPopover 并设置 :surface="false"
  • 操作入口可以使用 AuMenuListAuMenuListItem;表单、图表或其他内容也可以直接放入插槽,没有组件绑定关系。

API

Attributes

属性说明类型默认值
tag根元素或动态组件string / Componentsection
padding内容留白,可选 none / compact / default / comfortablestringdefault
depth深度,可选 none / surface / overlaystringsurface
bordered是否显示材质边框booleantrue
scrollable主体区域是否独立滚动booleanfalse
width面板宽度,数字自动转为 pxstring / number''
maxHeight最大高度,数字自动转为 pxstring / number''
role可选的无障碍角色string''
ariaLabel面板无障碍名称string''
ariaLabelledby标题元素 IDstring''
ariaDescribedby说明元素 IDstring''

Slots

插槽名说明
header用户自定义头部内容
default用户自定义主体内容
footer用户自定义尾部内容

Aurora Plus · Vue 3 Component Library