// Utils
import { createNamespace } from '../utils';
import { BORDER_BOTTOM } from '../utils/constant';
// Components
import Icon from '../icon';
const [createComponent, bem] = createNamespace('nav-bar');
export default createComponent({
props: {
title: String,
fixed: Boolean,
zIndex: [Number, String],
leftText: String,
rightText: String,
leftArrow: Boolean,
placeholder: Boolean,
safeAreaInsetTop: Boolean,
border: {
type: Boolean,
default: true,
},
},
data() {
return {
height: null,
};
},
mounted() {
if (this.placeholder && this.fixed) {
const setHeight = () => {
this.height = this.$refs.navBar.getBoundingClientRect().height;
};
setHeight();
// https://github.com/vant-ui/vant/issues/10131
setTimeout(setHeight, 100);
}
},
methods: {
genLeft() {
const leftSlot = this.slots('left');
if (leftSlot) {
return leftSlot;
}
return [
this.leftArrow &&