收藏
回答

input输入框placeholder未显示

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug input 微信安卓客户端 7.0.10 1.4.0

华为手机mate 20x

微信版本7.0.10也出现这样的问题。第一次进来没有;删掉小程序重新进来就又有了

回答关注问题邀请回答
收藏

3 个回答

  • 禾店短剧系统
    禾店短剧系统
    2021-06-10

    if (!('placeholder' in document.createElement('input'))) {

     

        $('input[placeholder],textarea[placeholder]').each(function () {

     

            var that = $(this),

     

                text = that.attr('placeholder');

     

            if (that.val() === "") {

     

                that.val(text).addClass('placeholder');

     

            }

     

            that.focus(function () {

     

                if (that.val() === text) {

     

                    that.val("").removeClass('placeholder');

     

                }

     

            }).blur(function () {

     

                if (that.val() === "") {

     

                    that.val(text).addClass('placeholder');

     

                }

     

            }).closest('form').submit(function () {

     

                if (that.val() === text) {

     

                    that.val('');

     

                }

     

            });

     

        });

     

    }

    2021-06-10
    有用 1
    回复
  • Luyc
    Luyc
    2021-01-08

    您好,小米八,miui12.0.3也是必现的,能处理一下吗?不点击的话是不会,代码如下:

    <view class="content">

       <text class="text">救援人员姓名</text>

       <input class="weui-inputplaceholder='请输入value="{{rescueName}}bindinput="rescueName"

          bindfocus="bindfocusName" />

    </view>


    <view class="content">

       <text class="text">救援人员电话</text>

       <input class="weui-inputplaceholder="请输入value="{{rescuePhone}}bindinput="rescuePhone"

          bindfocus="bindfocusName" />

    </view>

    .weui-input {

       width: 64%;

       position: relative;

       display: flex;

       text-align: right;

       flex-direction: row-reverse;

    }


    2021-01-08
    有用
    回复
  • 灵芝
    灵芝
    2020-01-08

    你好,问题是必现的么?这边未复现问题,请提供能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html

    另外,请真机打开调试-vconsole-system截图看看

    2020-01-08
    有用
    回复 3
    • 江边雪🎇
      江边雪🎇
      2020-01-09
      第一次进小程序的时候没有,删掉小程序再进来后就有了。。。
      2020-01-09
      回复
    • 灵芝
      灵芝
      2020-01-09回复江边雪🎇
      麻烦给个代码片段看下
      2020-01-09
      回复
    • Luyc
      Luyc
      2021-01-08
      小米八,miui12.0.3百分百出现这个问题
      2021-01-08
      回复
登录 后发表内容
问题标签