|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <view :class="classes" v-show="state.showWrapper">
|
|
|
|
|
|
|
+ <view :class="classes" v-show="state.showWrapper" style="position: fixed" :style="{ zIndex: state.zIndex }">
|
|
|
<div
|
|
<div
|
|
|
v-show="state.isShowPlaceholderElement"
|
|
v-show="state.isShowPlaceholderElement"
|
|
|
@click="handleClickOutside"
|
|
@click="handleClickOutside"
|
|
@@ -9,10 +9,8 @@
|
|
|
>
|
|
>
|
|
|
</div>
|
|
</div>
|
|
|
<nut-popup
|
|
<nut-popup
|
|
|
- :style="
|
|
|
|
|
- parent.props.direction === 'down' ? { top: parent.offset.value + 'px' } : { bottom: parent.offset.value + 'px' }
|
|
|
|
|
- "
|
|
|
|
|
- :overlayStyle="
|
|
|
|
|
|
|
+ class="menu-item__pop-container"
|
|
|
|
|
+ :containerStyle="
|
|
|
parent.props.direction === 'down' ? { top: parent.offset.value + 'px' } : { bottom: parent.offset.value + 'px' }
|
|
parent.props.direction === 'down' ? { top: parent.offset.value + 'px' } : { bottom: parent.offset.value + 'px' }
|
|
|
"
|
|
"
|
|
|
v-bind="$attrs"
|
|
v-bind="$attrs"
|
|
@@ -20,7 +18,6 @@
|
|
|
:position="parent.props.direction === 'down' ? 'top' : 'bottom'"
|
|
:position="parent.props.direction === 'down' ? 'top' : 'bottom'"
|
|
|
:duration="parent.props.duration"
|
|
:duration="parent.props.duration"
|
|
|
pop-class="nut-menu__pop"
|
|
pop-class="nut-menu__pop"
|
|
|
- transition="transition-none"
|
|
|
|
|
overlayClass="nut-menu__overlay"
|
|
overlayClass="nut-menu__overlay"
|
|
|
:overlay="parent.props.overlay"
|
|
:overlay="parent.props.overlay"
|
|
|
:lockScroll="parent.props.lockScroll"
|
|
:lockScroll="parent.props.lockScroll"
|
|
@@ -68,7 +65,7 @@ import { createComponent } from '@/packages/utils/create';
|
|
|
const { componentName, create } = createComponent('menu-item');
|
|
const { componentName, create } = createComponent('menu-item');
|
|
|
import Icon from '../icon/index.taro.vue';
|
|
import Icon from '../icon/index.taro.vue';
|
|
|
import Popup from '../popup/index.taro.vue';
|
|
import Popup from '../popup/index.taro.vue';
|
|
|
-
|
|
|
|
|
|
|
+let _zIndex = 2000;
|
|
|
export default create({
|
|
export default create({
|
|
|
props: {
|
|
props: {
|
|
|
title: String,
|
|
title: String,
|
|
@@ -99,6 +96,7 @@ export default create({
|
|
|
emits: ['update:modelValue', 'change'],
|
|
emits: ['update:modelValue', 'change'],
|
|
|
setup(props, { emit, slots }) {
|
|
setup(props, { emit, slots }) {
|
|
|
const state = reactive({
|
|
const state = reactive({
|
|
|
|
|
+ zIndex: _zIndex,
|
|
|
showPopup: false,
|
|
showPopup: false,
|
|
|
transition: true,
|
|
transition: true,
|
|
|
showWrapper: false,
|
|
showWrapper: false,
|
|
@@ -153,6 +151,7 @@ export default create({
|
|
|
|
|
|
|
|
if (show) {
|
|
if (show) {
|
|
|
state.showWrapper = true;
|
|
state.showWrapper = true;
|
|
|
|
|
+ state.zIndex = ++_zIndex;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|