first
This commit is contained in:
1
node_modules/vant/es/nav-bar/index.css
generated
vendored
Normal file
1
node_modules/vant/es/nav-bar/index.css
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
.van-nav-bar{position:relative;z-index:1;line-height:22px;text-align:center;background-color:#fff;-webkit-user-select:none;user-select:none}.van-nav-bar--fixed{position:fixed;top:0;left:0;width:100%}.van-nav-bar--safe-area-inset-top{padding-top:constant(safe-area-inset-top);padding-top:env(safe-area-inset-top)}.van-nav-bar .van-icon{color:#1989fa}.van-nav-bar__content{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;height:46px}.van-nav-bar__arrow{margin-right:4px;font-size:16px}.van-nav-bar__title{max-width:60%;margin:0 auto;color:#323233;font-weight:500;font-size:16px}.van-nav-bar__left,.van-nav-bar__right{position:absolute;top:0;bottom:0;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;padding:0 16px;font-size:14px;cursor:pointer}.van-nav-bar__left:active,.van-nav-bar__right:active{opacity:.7}.van-nav-bar__left{left:0}.van-nav-bar__right{right:0}.van-nav-bar__text{color:#1989fa}
|
132
node_modules/vant/es/nav-bar/index.js
generated
vendored
Normal file
132
node_modules/vant/es/nav-bar/index.js
generated
vendored
Normal file
@ -0,0 +1,132 @@
|
||||
// Utils
|
||||
import { createNamespace } from '../utils';
|
||||
import { BORDER_BOTTOM } from '../utils/constant'; // Components
|
||||
|
||||
import Icon from '../icon';
|
||||
|
||||
var _createNamespace = createNamespace('nav-bar'),
|
||||
createComponent = _createNamespace[0],
|
||||
bem = _createNamespace[1];
|
||||
|
||||
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: function data() {
|
||||
return {
|
||||
height: null
|
||||
};
|
||||
},
|
||||
mounted: function mounted() {
|
||||
var _this = this;
|
||||
|
||||
if (this.placeholder && this.fixed) {
|
||||
var setHeight = function setHeight() {
|
||||
_this.height = _this.$refs.navBar.getBoundingClientRect().height;
|
||||
};
|
||||
|
||||
setHeight(); // https://github.com/vant-ui/vant/issues/10131
|
||||
|
||||
setTimeout(setHeight, 100);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
genLeft: function genLeft() {
|
||||
var h = this.$createElement;
|
||||
var leftSlot = this.slots('left');
|
||||
|
||||
if (leftSlot) {
|
||||
return leftSlot;
|
||||
}
|
||||
|
||||
return [this.leftArrow && h(Icon, {
|
||||
"class": bem('arrow'),
|
||||
"attrs": {
|
||||
"name": "arrow-left"
|
||||
}
|
||||
}), this.leftText && h("span", {
|
||||
"class": bem('text')
|
||||
}, [this.leftText])];
|
||||
},
|
||||
genRight: function genRight() {
|
||||
var h = this.$createElement;
|
||||
var rightSlot = this.slots('right');
|
||||
|
||||
if (rightSlot) {
|
||||
return rightSlot;
|
||||
}
|
||||
|
||||
if (this.rightText) {
|
||||
return h("span", {
|
||||
"class": bem('text')
|
||||
}, [this.rightText]);
|
||||
}
|
||||
},
|
||||
genNavBar: function genNavBar() {
|
||||
var _ref;
|
||||
|
||||
var h = this.$createElement;
|
||||
return h("div", {
|
||||
"ref": "navBar",
|
||||
"style": {
|
||||
zIndex: this.zIndex
|
||||
},
|
||||
"class": [bem({
|
||||
fixed: this.fixed,
|
||||
'safe-area-inset-top': this.safeAreaInsetTop
|
||||
}), (_ref = {}, _ref[BORDER_BOTTOM] = this.border, _ref)]
|
||||
}, [h("div", {
|
||||
"class": bem('content')
|
||||
}, [this.hasLeft() && h("div", {
|
||||
"class": bem('left'),
|
||||
"on": {
|
||||
"click": this.onClickLeft
|
||||
}
|
||||
}, [this.genLeft()]), h("div", {
|
||||
"class": [bem('title'), 'van-ellipsis']
|
||||
}, [this.slots('title') || this.title]), this.hasRight() && h("div", {
|
||||
"class": bem('right'),
|
||||
"on": {
|
||||
"click": this.onClickRight
|
||||
}
|
||||
}, [this.genRight()])])]);
|
||||
},
|
||||
hasLeft: function hasLeft() {
|
||||
return this.leftArrow || this.leftText || this.slots('left');
|
||||
},
|
||||
hasRight: function hasRight() {
|
||||
return this.rightText || this.slots('right');
|
||||
},
|
||||
onClickLeft: function onClickLeft(event) {
|
||||
this.$emit('click-left', event);
|
||||
},
|
||||
onClickRight: function onClickRight(event) {
|
||||
this.$emit('click-right', event);
|
||||
}
|
||||
},
|
||||
render: function render() {
|
||||
var h = arguments[0];
|
||||
|
||||
if (this.placeholder && this.fixed) {
|
||||
return h("div", {
|
||||
"class": bem('placeholder'),
|
||||
"style": {
|
||||
height: this.height + "px"
|
||||
}
|
||||
}, [this.genNavBar()]);
|
||||
}
|
||||
|
||||
return this.genNavBar();
|
||||
}
|
||||
});
|
74
node_modules/vant/es/nav-bar/index.less
generated
vendored
Normal file
74
node_modules/vant/es/nav-bar/index.less
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
@import '../style/var';
|
||||
|
||||
.van-nav-bar {
|
||||
position: relative;
|
||||
z-index: @nav-bar-z-index;
|
||||
line-height: @line-height-lg;
|
||||
text-align: center;
|
||||
background-color: @nav-bar-background-color;
|
||||
user-select: none;
|
||||
|
||||
&--fixed {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&--safe-area-inset-top {
|
||||
padding-top: constant(safe-area-inset-top);
|
||||
padding-top: env(safe-area-inset-top);
|
||||
}
|
||||
|
||||
.van-icon {
|
||||
color: @nav-bar-icon-color;
|
||||
}
|
||||
|
||||
&__content {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: @nav-bar-height;
|
||||
}
|
||||
|
||||
&__arrow {
|
||||
margin-right: @padding-base;
|
||||
font-size: @nav-bar-arrow-size;
|
||||
}
|
||||
|
||||
&__title {
|
||||
max-width: 60%;
|
||||
margin: 0 auto;
|
||||
color: @nav-bar-title-text-color;
|
||||
font-weight: @font-weight-bold;
|
||||
font-size: @nav-bar-title-font-size;
|
||||
}
|
||||
|
||||
&__left,
|
||||
&__right {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 @padding-md;
|
||||
font-size: @font-size-md;
|
||||
cursor: pointer;
|
||||
|
||||
&:active {
|
||||
opacity: @active-opacity;
|
||||
}
|
||||
}
|
||||
|
||||
&__left {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
&__right {
|
||||
right: 0;
|
||||
}
|
||||
|
||||
&__text {
|
||||
color: @nav-bar-text-color;
|
||||
}
|
||||
}
|
4
node_modules/vant/es/nav-bar/style/index.js
generated
vendored
Normal file
4
node_modules/vant/es/nav-bar/style/index.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import '../../style/base.css';
|
||||
import '../../info/index.css';
|
||||
import '../../icon/index.css';
|
||||
import '../index.css';
|
4
node_modules/vant/es/nav-bar/style/less.js
generated
vendored
Normal file
4
node_modules/vant/es/nav-bar/style/less.js
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
import '../../style/base.less';
|
||||
import '../../info/index.less';
|
||||
import '../../icon/index.less';
|
||||
import '../index.less';
|
Reference in New Issue
Block a user