b2nil / taro-ui-vue3

采用 Vue 3.0 重写的 Taro UI 组件库
https://b2nil.github.io/taro-ui-vue3/
MIT License
160 stars 51 forks source link

at-search-bar组件的onClear事件无效 #88

Closed angeltxwh closed 3 years ago

angeltxwh commented 3 years ago

问题描述

点击clear按钮无法触发handleClear方法,并且我看文档说不传onClear方法也会清空搜索文本,但是实际测试无论传不传onClear方法都不会清空搜索文本

版本信息

^1.0.0-alpha.18

涉及的平台

weapp(目前只测试了微信平台)

错误信息

-

代码

<at-search-bar v-model:value="searchValue" @clear="handleClear" />

handleClear() {
this.searchValue = "";
}
b2nil commented 3 years ago

先看看你的 vue 和 @vue/compiler-sfc 的版本,如果高于 3.0.5,请将版本固定在 3.0.5 再试一下。

angeltxwh commented 3 years ago

VUE版本3.0.0

angeltxwh commented 3 years ago

尝试最新版3.0.7和大佬推荐版本3.0.5后发现:

307版本问题依旧,305版本问题改善

另外想请教下大佬这具体是什么原因呢?

b2nil commented 3 years ago

这是 vue@3.0.6 中引入的一个 commit 导致的问题,详情看这个 taro issue

b2nil commented 3 years ago

Fixed in v1.0.0-alpha.19. Update to v1.0.0-alpha.19, and use the latest vue version as you wish.