lilishop-uniapp/pages/tabbar/home/template/tpl_title.vue

53 lines
1.2 KiB
Vue
Raw Normal View History

2021-05-13 11:03:32 +08:00
<template>
2022-04-18 09:51:00 +08:00
<div class="layout" :style="{textAlign: res.list[0].textAlign}">
<div class="background" :style="{ backgroundColor: res.list[0].bk_color}">
2021-05-24 15:49:22 +08:00
<div class="title" :style="{ color: res.list[0].color }">
{{ res.list[0].title }}
</div>
2022-04-18 09:51:00 +08:00
<div style="position: absolute;right: 10px;top:2px;color: #fff;line-height: 42px;font-size: 10px">
<a :href="res.list[0].url" :style="{ color: res.list[0].color1 }" style="text-decoration: none">{{ res.list[0].title1 }}</a>
</div>
2021-05-24 15:49:22 +08:00
</div>
</div>
2021-05-13 11:03:32 +08:00
</template>
2022-04-18 09:51:00 +08:00
2021-05-13 11:03:32 +08:00
<script>
2021-05-24 15:49:22 +08:00
export default {
title: "标题栏",
props: ["res"],
mounted() {},
};
2021-05-13 11:03:32 +08:00
</script>
<style lang="scss" scoped>
2021-05-24 15:49:22 +08:00
@import "./tpl.scss";
.background {
2022-04-18 09:51:00 +08:00
// background: url("/static/title.png") no-repeat;
2021-05-24 15:49:22 +08:00
position: absolute;
z-index: 2;
width: 100%;
height: 84rpx;
background-position-x: center;
background-position-y: center;
background-size: cover;
}
2021-05-13 11:03:32 +08:00
2021-05-24 15:49:22 +08:00
.layout {
text-align: center;
position: relative;
height: 84rpx;
display: flex;
align-items: center;
justify-content: center;
2021-05-13 11:03:32 +08:00
2021-05-24 15:49:22 +08:00
background: #ffffff;
}
2021-05-13 11:03:32 +08:00
2021-05-24 15:49:22 +08:00
.title {
line-height: 84rpx;
font-size: 30rpx;
font-weight: bold;
2022-04-18 09:51:00 +08:00
margin-left: 8rpx;
2021-05-24 15:49:22 +08:00
}
2021-05-13 11:03:32 +08:00
</style>