| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <template>
- <div class="common-banner" :style="{'height': height + 'px'}">
- <img class="bg-img" :src="img" :style="{'height': height + 'px', 'max-height': height + 'px'}" alt="" srcset="">
- <slot></slot>
- </div>
- </template>
- <script>
- export default {
- props: {
- img: {
- type: String,
- default: ''
- },
- height: {
- type: Number,
- default: 521
- }
- },
- data() {
- return {
- // bannerImg: require('~/assets/images/products/product_banner.png')
- }
- }
- }
- </script>
- <style lang="scss">
- .common-banner {
- width: 100%;
- // height: 521px;
- position: relative;
- margin: 0 auto;
- overflow: hidden;
- text-align: center;
- .bg-img {
- position: absolute;
- top: 0px;
- left: 50%;
- bottom: 0px;
- right: 0px;
- z-index: 1;
- -webkit-transform: translateX(-50%);
- transform: translateX(-50%);
- max-width: 2560px;
- // max-height: 521px;
- // height: 521px;
- display: block;
- }
- h2 {
- position: absolute;
- top: 250px;
- left: 50%;
- transform: translateX(-50%);
- font-size: 66px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- z-index: 10;
- }
- }
- .content-wrap {
- margin-top: 94px;
- width: 100%;
- position: absolute;
- z-index: 10;
- .content {
- display: flex;
- justify-content: space-between;
- align-items: center;
- }
- .title {
- width: 396px;
- height: 92px;
- font-size: 66px;
- font-family: PingFangSC-Medium, PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 92px;
- }
- }
- </style>
|