mirror of
https://github.com/youzan/vant.git
synced 2025-10-20 18:54:24 +00:00
feat(IndexBar): add @index-anchor-z-index、@index-bar-sidebar-z-index less var
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Utils
|
||||
import { createNamespace } from '../utils';
|
||||
import { createNamespace, isDef } from '../utils';
|
||||
import { GREEN } from '../utils/constant';
|
||||
import { isHidden } from '../utils/dom/style';
|
||||
import { preventDefault } from '../utils/dom/event';
|
||||
@@ -43,14 +43,11 @@ export default createComponent({
|
||||
],
|
||||
|
||||
props: {
|
||||
zIndex: Number,
|
||||
sticky: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
zIndex: {
|
||||
type: Number,
|
||||
default: 1,
|
||||
},
|
||||
highlightColor: {
|
||||
type: String,
|
||||
default: GREEN,
|
||||
@@ -72,6 +69,14 @@ export default createComponent({
|
||||
},
|
||||
|
||||
computed: {
|
||||
sidebarStyle() {
|
||||
if (isDef(this.zIndex)) {
|
||||
return {
|
||||
zIndex: this.zIndex + 1,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
highlightStyle() {
|
||||
const { highlightColor } = this;
|
||||
if (highlightColor) {
|
||||
@@ -237,7 +242,7 @@ export default createComponent({
|
||||
<div class={bem()}>
|
||||
<div
|
||||
class={bem('sidebar')}
|
||||
style={{ zIndex: this.zIndex + 1 }}
|
||||
style={this.sidebarStyle}
|
||||
onClick={this.onClick}
|
||||
onTouchstart={this.touchStart}
|
||||
onTouchmove={this.onTouchMove}
|
||||
|
Reference in New Issue
Block a user