w-navbar.vue 1.97 KB
<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>