小程序中textarea层级最高的结局办法
生活随笔
收集整理的這篇文章主要介紹了
小程序中textarea层级最高的结局办法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在小程序中textarea層級比較高,當底部有fiexd定位的時候或出現文本框中的文本穿透顯示出來,解決辦法是在texarea標簽下面添加一個view或者text標簽來和texarea標簽替換使用
<view class='textarea_wrap'> <textarea class='resource-textarea' wx:if='{{isshowtext==true}}' placeholder="添加產品亮點、參數、細節等" maxlength='-1' name='introduce' placeholder-class="p-input" auto-height='true' bindblur='onremarkinput' focus='{{onFocuse}}' value='{{introduce}}'></textarea><view class='replace_textare' wx:if="{{isshowtext==false&&introduce!=''}}" bindtap='onshowtexarea' style='padding-left:10rpx;min-height:134rpx;margin:0 0 20rpx 12rpx;width:95%;font-size:28rpx;color:#666' >{{introduce}}</view><view class='replace_textare' wx:if="{{isshowtext==false&&introduce==''}}" bindtap='onshowtexarea' style='padding-left:10rpx;min-height:134rpx;margin:0 0 20rpx 12rpx;width:95%;font-size:28rpx;color:#999;' >添加產品亮點、參數、細節等</view></view> data{// 多行文本框onFocus: false,isshowtext: false,introduce: '', }// 多行文本框解決辦法onshowtexarea() {var self = thisself.setData({onFocus: true,isshowtext: true})},onremarkinput(e) {var value = e.detail.valuethis.setData({introduce: value,onFocus: false,isshowtext: false})},總結
以上是生活随笔為你收集整理的小程序中textarea层级最高的结局办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: html中使用js将axios请求封装
- 下一篇: 微信小程序自定义状态栏