1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<template>
<u-navbar
:height="height"
:background="background"
:back-icon-color="navbarColor"
:title="title"
:titleColor="navbarColor"
:is-back="isBack"
:is-fixed="isFixed"
:title-bold="true"
:custom-back="customBack"
:border-bottom="false">
</u-navbar>
</template>
<script>
/**
* navbar 自定义导航栏
* @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
* @tutorial https://www.uviewui.com/components/navbar.html
* @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认40)
* @property {String} navbar-Color 导航栏内容的颜色(默认#333333)
* @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
* @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
* @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
* @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
* @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
* @example <w-navbar title="剑未配妥,出门已是江湖"></w-navbar>
*/
export default {
name:"w-navbar",
props: {
height: {
type: String,
default: "44"
},
background: {
type: Object,
default(){
return {
backgroundColor: 'none'
}
}
},
navbarColor: {
type: String,
default: "#333333"
},
title: {
type: String,
default: ""
},
titleBold: {
type: Boolean,
default: true
},
isBack: {
type: Boolean,
default: true
},
isFixed: {
type: Boolean,
default: true
},
customBack: {
type: Function
}
},
data() {
return {
};
}
}
</script>
<style lang="scss">
</style>