Files
hht-hengsen-acs-uni/components/NavBar.vue

63 lines
1.0 KiB
Vue
Raw Normal View History

2025-06-18 17:30:31 +08:00
<template>
<view class="header">
<span @tap="goBack" class="iconfont icon_back">&#xe6db;</span>
<span class="page_name">{{title}}</span>
<span @tap="backHome" class="iconfont icon_home" :class="{'vhide': show1 === false}">&#xe69b;</span>
</view>
</template>
<script>
export default {
data() {
return {
};
},
props: {
title: String,
inner: {
type: Boolean,
default: false
},
inner2: {
type: Boolean,
default: false
},
show1: {
type: Boolean,
default: true
}
},
methods: {
goBack () {
if (this.inner) {
uni.navigateBack()
} else if (this.inner2) {
this.$emit('goIn')
} else {
uni.redirectTo({
url: '/pages/home/home'
})
}
},
backHome () {
uni.redirectTo({
url: '/pages/home/home'
})
}
}
}
</script>
<style lang="stylus">
@import '@/common/style/mixin.styl';
.header
_fj()
position fixed
_wh(100%, 72rpx)
background-color $red
z-index 200
padding 0 20rpx
.page_name
_font(32rpx, 32rpx, #fff,700,center)
</style>