使用uni-app中的<uni-data-select>組件,小程序會出現(xiàn)事件點擊穿透問題
如下圖:下拉框點擊的時候會直接聚焦到下面的input框
<uni-data-select v-model="personInfo.storeId" :localdata="storeList" @change="storeIdChange"
:clear="false"></uni-data-select>
解決辦法
找到引用的<uni-data-select>組件,給uni-select__selector的z-index加高一點,默認(rèn)是2
.uni-select__selector {
/* #ifndef APP-NVUE */
box-sizing: border-box;
/* #endif */
position: absolute;
top: calc(100% + 12px);
left: 0;
width: 100%;
background-color: #FFFFFF;
border: 1px solid #EBEEF5;
border-radius: 6px;
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
z-index: 99999;
padding: 4px 0;
}