使用通过 useExtendedLib 扩展库 的方式引入,如何确认是最新版本?
发布于 4 年前 作者 wyang 3643 次浏览 来自 官方Issues

通过 useExtendedLib 扩展库 的方式引入weUI searchbar组件,定义了bindcancel事件绑定,但是点击“取消”文本时,searchCancel事件没有触发。模拟器和真机都无效。

wxml:

            <mp-searchbar id="search" bindselectresult="selectResult" search="{{search}}" bindcancel="searchCancel"></mp-searchbar>

js:

    searchCancel: function(){

        var _this = this;

        var markers = _this.getMarkers(stations);

        _this.setData({

            markers: markers,

        })

    }

查看https://github.com/wechat-miniprogram/weui-miniprogram/blob/master/src/searchbar/searchbar.ts

12天前更新了,增加了this.triggerEvent(‘cancel’)

hideInput() { this.setData({ searchState: false }) this.triggerEvent(‘cancel’) },

我的问题:

是因为我电脑上没有更新吗?怎么确认 useExtendedLib 扩展库 已更新?或者如何更新?

2 回复

你好,请参考文档:https://developers.weixin.qq.com/miniprogram/dev/extended/weui/search.html,没有找到bindcance,具体以文档为准。

大师,您这个答复没到点子上啊。

我换了npm安装的方式,直接就触发了bindcancel事件

那说明hideInput()里this.triggerEvent(‘cancel’)是有效的…

所以还是疑惑useExtendedLib 扩展库的更新机制是怎样的?

回到顶部