2023-04-07 15:44:01 +08:00

52 lines
787 B
Vue

<template>
<view class="title-bar flex-center">
<view class="back" @click="back">
<text class="iconfont icon-packup"></text>
</view>
<view class="content"><slot></slot></view>
</view>
</template>
<script>
export default {
name: "CustNavBar",
data() {
return {}
},
methods:{
back(){
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.title-bar{
position: fixed;
top:0;
left:0;
right:0;
padding:10px;
z-index: 2;
}
.back{
background-color: rgba(0, 0, 0, 0.5);
border-radius: 40px;
color: #fff;
display: inline-block;
padding: 4px;
}
.icon-packup{
transform: rotate(-90deg);
font-size: 20px;
display: block;
width: 24px;
height: 24px;
position: relative;
top:-1px
}
.content{
flex:1;
}
</style>