chore: add getZIndexStyle util (#8254)
This commit is contained in:
@@ -85,19 +85,19 @@ export default createComponent({
|
||||
|
||||
linkChildren({ props });
|
||||
|
||||
const sidebarStyle = computed(() => {
|
||||
const sidebarStyle = computed<CSSProperties | undefined>(() => {
|
||||
if (isDef(props.zIndex)) {
|
||||
return {
|
||||
zIndex: +props.zIndex + 1,
|
||||
} as CSSProperties;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
const highlightStyle = computed(() => {
|
||||
const highlightStyle = computed<CSSProperties | undefined>(() => {
|
||||
if (props.highlightColor) {
|
||||
return {
|
||||
color: props.highlightColor,
|
||||
} as CSSProperties;
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -870,9 +870,7 @@ exports[`should render demo and match snapshot 1`] = `
|
||||
</div>
|
||||
<div>
|
||||
<div style="height: 0px;">
|
||||
<div class="van-index-anchor van-index-anchor--sticky van-hairline--bottom"
|
||||
style="z-index: undefined;"
|
||||
>
|
||||
<div class="van-index-anchor van-index-anchor--sticky van-hairline--bottom">
|
||||
Z
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -300,9 +300,7 @@ exports[`should update active anchor after page scroll 2`] = `
|
||||
<div data-index="0"
|
||||
style="height: 10px;"
|
||||
>
|
||||
<div class="van-index-anchor van-index-anchor--sticky van-hairline--bottom"
|
||||
style="z-index: undefined;"
|
||||
>
|
||||
<div class="van-index-anchor van-index-anchor--sticky van-hairline--bottom">
|
||||
1
|
||||
</div>
|
||||
</div>
|
||||
@@ -310,7 +308,7 @@ exports[`should update active anchor after page scroll 2`] = `
|
||||
style="height: 10px;"
|
||||
>
|
||||
<div class="van-index-anchor van-index-anchor--sticky van-hairline--bottom"
|
||||
style="z-index: undefined; transform: translate3d(0, 10px, 0);"
|
||||
style="transform: translate3d(0, 10px, 0);"
|
||||
>
|
||||
2
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user