Files
dvcp_v2_wxcp_app/src/components/AiTopFixed.vue

71 lines
1.2 KiB
Vue
Raw Normal View History

2021-11-15 10:29:05 +08:00
<template>
<section class="AiTopFixed" :style="{background}">
<!--占位区-->
<div class="placeholder">
<div v-if="$slots.tabs">
<slot name="tabs"/>
</div>
<div class="content" v-if="$slots.default">
<slot/>
</div>
</div>
<!--悬浮区-->
<div class="fixed" :style="{background}">
<div v-if="$slots.tabs">
<slot name="tabs"/>
</div>
<div class="content" v-if="$slots.default">
<slot/>
</div>
</div>
</section>
</template>
<script>
export default {
name: "AiTopFixed",
props: {
background: {default: "#fff"}
}
}
</script>
<style lang="scss" scoped>
.AiTopFixed {
width: 100%;
& > div {
width: 100%;
}
.fixed {
2021-12-07 15:17:19 +08:00
display: flex;
align-items: center;
2021-11-15 10:29:05 +08:00
width: 100%;
2021-12-07 15:17:19 +08:00
height: 100rpx;
2021-11-15 10:29:05 +08:00
top: 0;
position: fixed;
z-index: 9;
}
.placeholder {
visibility: hidden;
opacity: 0;
}
.content {
2021-12-07 15:17:19 +08:00
display: flex;
align-items: center;
width: 100%;
height: 100rpx;
padding: 0 32px;
2021-11-15 10:29:05 +08:00
box-sizing: border-box;
}
::v-deep .u-search {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.02);
margin-bottom: 32px !important;
}
}
</style>