|
<template>
<safe-area class="nav-bar" :style="{background: this.props.bgColor || '#fff'}">
<safe-area v-if="this.props.isShowBack" @click="back" class="nav-bar-back">
<img :src="this.props.backImg || '../../image/back.png' " alt="back" class="nav-bar-back-icon" />
</safe-area>
<text class="nav-bar-title" :style="{color: this.props.textColor || '#242833'}">{title}</text>
<safe-area class="nav-bar-right" v-if="this.props.isShowRight" @click="onClickRightText">
<text class="right-text" :style="{color: this.props.optionColor || '#005faa'}">{option}</text>
</safe-area>
<safe-area class="nav-bar-right" v-if="this.props.isShowRightImg" @click="onClickRight">
<img :src="this.props.rightImg"
:style="{height:this.props.imgHeight || '24px'}" :style="{width:this.props.imgWidth || '24px'}" />
</safe-area>
<safe-area class="nav-bar-right" v-if="this.props.isShowRightTextImg">
<view class="nav-bar-tex-img">
<text class="right-text" :style="{color: this.props.optionColor || '#005faa'}" @click="onClickRightText">{option}</text>
<img :src="this.props.rightImg" class="nav-bar-right-text-icon"
:style="{height:this.props.imgHeight || '13px'}" :style="{width:this.props.imgWidth || '13px'}" @click="onClickRight"/>
</view>
</safe-area>
</safe-area>
</template>
<script>
export default {
name: 'header',
props: {
title: String,
option: String,
},
apiready() {//like created
},
data() {
return {
}
},
methods: {
back() {
api.closeWin();
},
onClickRight() {
this.fire('result');
},
onClickRightText(){
this.fire('text');
}
}
}
</script>
|
|