You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
< docs >
-- -
order : 8
iframe : 360
title :
zh - CN : 固定头部
en - US : Fixed Header
-- -
# # zh - CN
一般用于固定顶部导航 , 方便页面切换 。
# # en - US
Fixed Header is generally used to fix the top navigation to facilitate page switching .
< / docs >
< template >
< a -layout >
< a -layout -header : style = "{ position: 'fixed', zIndex: 1, width: '100%' }" >
< div class = "logo" / >
< a -menu
v -model :selectedKeys ="selectedKeys"
theme = "dark"
mode = "horizontal"
: style = "{ lineHeight: '64px' }"
>
< a -menu -item key = "1" > nav 1 < / a - m e n u - i t e m >
< a -menu -item key = "2" > nav 2 < / a - m e n u - i t e m >
< a -menu -item key = "3" > nav 3 < / a - m e n u - i t e m >
< / a - m e n u >
< / a - l a y o u t - h e a d e r >
< a -layout -content : style = "{ padding: '0 50px', marginTop: '64px' }" >
< a -breadcrumb : style = "{ margin: '16px 0' }" >
< a -breadcrumb -item > Home < / a - b r e a d c r u m b - i t e m >
< a -breadcrumb -item > List < / a - b r e a d c r u m b - i t e m >
< a -breadcrumb -item > App < / a - b r e a d c r u m b - i t e m >
< / a - b r e a d c r u m b >
< div : style = "{ background: '#fff', padding: '24px', minHeight: '380px' }" > Content < / div >
< / a - l a y o u t - c o n t e n t >
< a -layout -footer : style = "{ textAlign: 'center' }" >
Ant Design © 2018 Created by Ant UED
< / a - l a y o u t - f o o t e r >
< / a - l a y o u t >
< / template >
< script lang = "ts" setup >
import { ref } from 'vue' ;
const selectedKeys = ref < string [ ] > ( [ '2' ] ) ;
< / script >
< style scoped >
# components - layout - demo - fixed . logo {
width : 120 px ;
height : 31 px ;
background : rgba ( 255 , 255 , 255 , 0.2 ) ;
margin : 16 px 24 px 16 px 0 ;
float : left ;
}
. site - layout . site - layout - background {
background : # fff ;
}
[ data - theme = 'dark' ] . site - layout . site - layout - background {
background : # 141414 ;
}
< / style >