添加新文件
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
<template>
|
||||
<!-- 导航栏 -->
|
||||
<view class="header_" >
|
||||
<view style="margin-top: 10rpx;" @click="leftJump">
|
||||
<up-image src="/static/common/left.png" width="18" height="20" bgColor="#f1f6ff00" @click="jumpMine"/>
|
||||
</view>
|
||||
<view class="title_">{{leftTitle}}</view>
|
||||
<view @click="rightJump">{{rightTitle}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:"header",
|
||||
props: {
|
||||
leftTitle:{
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
leftPath:{
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
leftPathType:{
|
||||
type: String,
|
||||
default: "navigateTo"
|
||||
},
|
||||
rightTitle:{
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
rightPath:{
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
rightPathType:{
|
||||
type: String,
|
||||
default: "navigateTo"
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
leftJump() {
|
||||
const leftPath = this.leftPath;
|
||||
if(!leftPath){
|
||||
return;
|
||||
}
|
||||
const leftPathType = this.leftPathType;
|
||||
if(leftPathType === "navigateTo"){
|
||||
uni.navigateTo({
|
||||
url:leftPath,
|
||||
})
|
||||
}else if(leftPathType === "switchTab"){
|
||||
uni.switchTab({
|
||||
url: leftPath,
|
||||
});
|
||||
}
|
||||
},
|
||||
rightJump() {
|
||||
const rightPath = this.rightPath;
|
||||
if(!rightPath){
|
||||
return;
|
||||
}
|
||||
const rightPathType = this.rightPathType;
|
||||
if(rightPathType === "navigateTo"){
|
||||
uni.navigateTo({
|
||||
url:rightPath,
|
||||
})
|
||||
}else if(rightPathType === "switchTab"){
|
||||
uni.switchTab({
|
||||
url: rightPath,
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header_{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 74rpx 20rpx 20rpx;
|
||||
.title_{
|
||||
// font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #000000;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user