收藏
回答

searchbar怎么设置placeholder才生效啊?

wxml:

<mp-searchbar 

                id="search" 

                bindselectresult="selectResult" 

                search="{{search}}" 

                bindcancel="searchCancel"

                placeholder="{{searchbarplaceholder}}">

            </mp-searchbar>

js:

    data: {

        searchbarplaceholder"在水文站中搜索",

    },

无效

        var value = "在周边" + stations.length + "个水文站中搜索";

_this.setData({

            searchbarplaceholdervalue

        })

也无效

_this.selectComponent("#search").data.placeholder = value;

也无效。

cosole中查看_this.selectComponent("#search").data.placeholder值已经被修改了,但是界面上还是默认的“搜索”

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

1 个回答

  • lοひё㊤疜雨兲
    lοひё㊤疜雨兲
    2020-12-10

    同问,解决了吗,设置placeholder不起作用

    2020-12-10
    有用
    回复
登录 后发表内容
问题标签