From 838ae3af6da6e0f9ed5116bb7bdad1d5cadd15fd Mon Sep 17 00:00:00 2001 From: pengsl <18718574603@163.com> Date: Wed, 17 Mar 2021 01:12:14 +0800 Subject: [PATCH] fix: #106, #109 --- packages/taro-ui-vue/src/components/image-picker/index.ts | 4 ++++ packages/taro-ui-vue/src/components/search-bar/index.ts | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/taro-ui-vue/src/components/image-picker/index.ts b/packages/taro-ui-vue/src/components/image-picker/index.ts index 249217c..6395244 100644 --- a/packages/taro-ui-vue/src/components/image-picker/index.ts +++ b/packages/taro-ui-vue/src/components/image-picker/index.ts @@ -117,6 +117,10 @@ const AtImagePicker = { type: Array, default: () => ['album', 'camera'] }, + count: { + type: Number, + default: 1 + } }, computed: { rootCls() { diff --git a/packages/taro-ui-vue/src/components/search-bar/index.ts b/packages/taro-ui-vue/src/components/search-bar/index.ts index c830073..bd01d32 100644 --- a/packages/taro-ui-vue/src/components/search-bar/index.ts +++ b/packages/taro-ui-vue/src/components/search-bar/index.ts @@ -89,6 +89,10 @@ const AtSearchBar = { return function () {} }, }, + onClear: { + type: Function, + default: undefined, + } }, computed: { rootCls() { @@ -167,7 +171,7 @@ const AtSearchBar = { this.onChange(e.target.value, e) }, handleClear(event: CommonEvent): void { - if (this.onClear) { + if (this.onClear && typeof this.onClear === 'function') { this.onClear(event) } else { this.onChange('', event)