PageHeader.vue 1016 Bytes
<script setup>
/** 页面标题栏。一页一个 h1,右侧放主操作。不提供副标题/说明 slot。 */

defineProps({
  /** 页面标题。 */
  title: { type: String, required: true },
})
</script>

<template>
  <header class="drama-page-header">
    <h1>{{ title }}</h1>
    <div
      v-if="$slots.actions"
      class="drama-page-header__actions"
    >
      <slot name="actions" />
    </div>
  </header>
</template>

<style scoped>
/* 不带外边距:与下方内容的距离归页面容器(见 admin 的 `.vga-page`)。 */
.drama-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--drama-space-lg);
}

h1 {
  margin: 0;
  color: var(--drama-color-text);
  font-family: var(--drama-font-family-heading);
  font-size: var(--drama-font-size-xl);
  font-weight: var(--drama-font-weight-bold);
  line-height: var(--drama-line-height-tight);
}

.drama-page-header__actions {
  display: flex;
  align-items: center;
  gap: var(--drama-space-sm);
}
</style>