Files
hht-hf/src/components/NavBar.vue

43 lines
736 B
Vue
Raw Normal View History

2022-11-09 10:02:49 +08:00
<template>
<header>
<span @click="goBack" class="icon-back"></span>
<span class="fxcol">{{title}}</span>
<router-link to='/home' class="icon-home"></router-link>
</header>
</template>
<script>
export default {
name: 'NavBar',
props: {
title: String,
path: String,
inner: {
type: Boolean,
default: false
}
},
methods: {
goBack () {
if (this.inner) {
this.$emit('goIn')
} else {
this.$router.push('/home')
}
}
}
}
</script>
<style lang="stylus">
@import '~@style/mixin'
.icon-back
flex 0 0 .42rem
height .86rem
_bis('../images/back.png',.42rem)
.icon-home
flex 0 0 .4rem
height .86rem
_bis('../images/home.png', .4rem)
</style>