mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Improvement] NavBar: add zIndex prop (#525)
This commit is contained in:
parent
0bb1fe69a3
commit
a6dc2912ee
@ -52,6 +52,7 @@ export default {
|
|||||||
| right-text | Right Text | `String` | `''` | - |
|
| right-text | Right Text | `String` | `''` | - |
|
||||||
| left-arrow | Whether to show left arrow | `Boolean` | `false` | - |
|
| left-arrow | Whether to show left arrow | `Boolean` | `false` | - |
|
||||||
| fixed | Whether to fixed top | `Boolean` | `false` | - |
|
| fixed | Whether to fixed top | `Boolean` | `false` | - |
|
||||||
|
| z-index | Z-index | `Number` | `1` | - |
|
||||||
|
|
||||||
### Slot
|
### Slot
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ export default {
|
|||||||
| right-text | 右侧文案 | `String` | `''` | - |
|
| right-text | 右侧文案 | `String` | `''` | - |
|
||||||
| left-arrow | 是否显示左侧箭头 | `Boolean` | `false` | - |
|
| left-arrow | 是否显示左侧箭头 | `Boolean` | `false` | - |
|
||||||
| fixed | 是否固定在顶部 | `Boolean` | `false` | - |
|
| fixed | 是否固定在顶部 | `Boolean` | `false` | - |
|
||||||
|
| z-index | 元素 z-index | `Number` | `1` | - |
|
||||||
|
|
||||||
### Slot
|
### Slot
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="van-nav-bar van-hairline--top-bottom" :class="{ 'van-nav-bar--fixed': fixed }">
|
<div
|
||||||
|
class="van-nav-bar van-hairline--top-bottom"
|
||||||
|
:class="{ 'van-nav-bar--fixed': fixed }"
|
||||||
|
:style="style"
|
||||||
|
>
|
||||||
<div class="van-nav-bar__left" @click="$emit('click-left')">
|
<div class="van-nav-bar__left" @click="$emit('click-left')">
|
||||||
<slot name="left">
|
<slot name="left">
|
||||||
<icon v-if="leftArrow" class="van-nav-bar__arrow" name="arrow" />
|
<icon v-if="leftArrow" class="van-nav-bar__arrow" name="arrow" />
|
||||||
@ -28,7 +32,19 @@ export default create({
|
|||||||
leftText: String,
|
leftText: String,
|
||||||
rightText: String,
|
rightText: String,
|
||||||
leftArrow: Boolean,
|
leftArrow: Boolean,
|
||||||
fixed: Boolean
|
fixed: Boolean,
|
||||||
|
zIndex: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
style() {
|
||||||
|
return {
|
||||||
|
zIndex: this.zIndex
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user