mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
37 lines
679 B
Vue
37 lines
679 B
Vue
<template>
|
|
<header :class="ns.b()" :style="style">
|
|
<slot></slot>
|
|
</header>
|
|
</template>
|
|
<script lang="ts">
|
|
import { computed, defineComponent } from 'vue'
|
|
import { useNamespace } from '@element-plus/hooks'
|
|
|
|
import type { CSSProperties } from 'vue'
|
|
|
|
export default defineComponent({
|
|
name: 'ElHeader',
|
|
props: {
|
|
height: {
|
|
type: String,
|
|
default: null,
|
|
},
|
|
},
|
|
setup(props) {
|
|
const ns = useNamespace('header')
|
|
|
|
return {
|
|
style: computed(
|
|
() =>
|
|
(props.height
|
|
? {
|
|
'--el-header-height': props.height,
|
|
}
|
|
: {}) as CSSProperties
|
|
),
|
|
ns,
|
|
}
|
|
},
|
|
})
|
|
</script>
|