|
| 1 | +<template> |
| 2 | + <a-breadcrumb :style="{ margin: '16px 0' }"> |
| 3 | + <a-breadcrumb-item>{{ navigation_title }}</a-breadcrumb-item> |
| 4 | + |
| 5 | + <div class="header-left"> |
| 6 | + <a-button type="outline" status="success" shape="round" @click="handleOpenForm"> |
| 7 | + <template #icon> |
| 8 | + <icon-apps /> |
| 9 | + </template> |
| 10 | + <template #default>{{ now_site_title }}</template> |
| 11 | + </a-button> |
| 12 | + |
| 13 | + <a-button type="outline" status="success" shape="round" @click="refreshPage"> |
| 14 | + <template #icon> |
| 15 | + <icon-refresh /> |
| 16 | + </template> |
| 17 | + <template #default>重载源</template> |
| 18 | + </a-button> |
| 19 | + </div> |
| 20 | + |
| 21 | + <!-- 中间搜索框 --> |
| 22 | + <div class="header-center"> |
| 23 | + <a-input-search |
| 24 | + placeholder="搜索视频" |
| 25 | + enter-button |
| 26 | + @search="onSearch" |
| 27 | + style="width: 300px" |
| 28 | + /> |
| 29 | + </div> |
| 30 | + |
| 31 | + <!-- 右侧控制按钮 --> |
| 32 | + <div class="header-right"> |
| 33 | + <a-button type="outline" status="success" shape="round" @click="minimize"> |
| 34 | + <template #icon> |
| 35 | + <icon-bug /> |
| 36 | + </template> |
| 37 | + <template #default>调试</template> |
| 38 | + </a-button> |
| 39 | + |
| 40 | + <a-button type="outline" status="success" shape="round" @click="maximize"> |
| 41 | + <template #icon> |
| 42 | + <icon-settings /> |
| 43 | + </template> |
| 44 | + <template #default>设置</template> |
| 45 | + </a-button> |
| 46 | + <a-button type="outline" status="success" shape="round" @click="closeWindow"> |
| 47 | + <template #icon> |
| 48 | + <icon-user /> |
| 49 | + </template> |
| 50 | + <template #default>用户设置</template> |
| 51 | + </a-button> |
| 52 | + |
| 53 | + <slot name="default"></slot> |
| 54 | + </div> |
| 55 | + </a-breadcrumb> |
| 56 | +</template> |
| 57 | + |
| 58 | +<script setup> |
| 59 | +const props = defineProps({ |
| 60 | + navigation_title: String, |
| 61 | + now_site_title: String, |
| 62 | +}); |
| 63 | +const emit = defineEmits([ |
| 64 | + "handleOpenForm", |
| 65 | + "closeWindow", |
| 66 | + "maximize", |
| 67 | + "minimize", |
| 68 | + "refreshPage", |
| 69 | + "onSearch", |
| 70 | +]); |
| 71 | +
|
| 72 | +const handleOpenForm = () => { |
| 73 | + emit("handleOpenForm"); |
| 74 | +}; |
| 75 | +const refreshPage = () => { |
| 76 | + emit("refreshPage"); |
| 77 | +}; |
| 78 | +const onSearch = (value) => { |
| 79 | + emit("onSearch", value); |
| 80 | +}; |
| 81 | +
|
| 82 | +const closeWindow = () => { |
| 83 | + emit("closeWindow"); |
| 84 | +}; |
| 85 | +const minimize = () => { |
| 86 | + emit("minimize"); |
| 87 | +}; |
| 88 | +const maximize = () => { |
| 89 | + emit("maximize"); |
| 90 | +}; |
| 91 | +</script> |
| 92 | + |
| 93 | +<style scoped> |
| 94 | +.header-left, |
| 95 | +.header-right { |
| 96 | + display: flex; |
| 97 | + align-items: center; |
| 98 | +} |
| 99 | +
|
| 100 | +.header-left button, |
| 101 | +.header-right button { |
| 102 | + margin-right: 10px; |
| 103 | +} |
| 104 | +
|
| 105 | +.header-center { |
| 106 | + flex-grow: 1; |
| 107 | + display: flex; |
| 108 | + justify-content: center; |
| 109 | +} |
| 110 | +
|
| 111 | +.header-center a-input-search { |
| 112 | + width: 300px; |
| 113 | +} |
| 114 | +</style> |
0 commit comments