2***@qq.com
2***@qq.com
  • 发布:2025-08-11 11:30
  • 更新:2025-08-11 11:30
  • 阅读:17

在安卓环境nvue中使用position 遮罩层无论怎么设置都会覆盖输入框,除非输入框设置为fixed遮罩层设置为absolute,z-index无效,元素先后位置也无效

分类:nvue
<view class="mask" :style="{  
                position: 'fixed',  
                width: screenWidth + 'px',  
                height: `${screenHeight - (screenWidth / 750) * 1000}px`  
            }" v-if="inputStatus" @click="clickMask"></view>  

            <view class="mask" :style="{  
                position: 'absolute',  
                width: screenWidth + 'px',  
                height: `${screenHeight - inputHeihgt}px`  
            }" v-if="inputStatus" @click="clickMask"></view>  
            <view class="replyInput" :style="{bottom: inputHeihgt,position: 'absolute'}">  
                <view class="content">  
                    <textarea class="textarea" @focus="focus" :cursor-spacing="0" :focus="inputStatus" auto-height  
                        :adjust-position="false" @blur="blur" name="" v-model="reply.content" id="" cols="20" rows="1"  
                        :show-confirm-bar="false" :maxlength="200" :placeholder="reply.parentName?`回复${reply.parentName}`:''" />  
                </view>  
                <!-- <view v-if="inputStatus" class="funBtn"> -->  
                <view class="funBtn">  
                    <text class="btn" @touchend.prevent="sendComment()">  
                        发送  
                    </text>  
                </view>  
            </view>  

两个遮罩层是因为开始都是用fixed或者absolute是可以将输入框显示出来的,但是后面调试了几下就显示不出来了一直被遮罩层覆盖输入框的z-index设置也是高于遮罩层的

2025-08-11 11:30 负责人:无 分享
已邀请:

要回复问题请先登录注册