This is an automated email from the ASF dual-hosted git repository.
tw93 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex-ui.git
The following commit(s) were added to refs/heads/master by this push:
new 18aa5f6 [+] wxc-pan-item: add judgment before using element
new ff05432 Merge pull request #504 from ReedSun/bug-fix
18aa5f6 is described below
commit 18aa5f635650811b9606fc44ee8d946c264d1d0e
Author: ReedSun <[email protected]>
AuthorDate: Wed Sep 2 10:55:21 2020 +0800
[+] wxc-pan-item: add judgment before using element
---
packages/wxc-pan-item/index.vue | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/packages/wxc-pan-item/index.vue b/packages/wxc-pan-item/index.vue
index d301c0d..a24e425 100644
--- a/packages/wxc-pan-item/index.vue
+++ b/packages/wxc-pan-item/index.vue
@@ -63,10 +63,12 @@ under the License.
setTimeout(() => {
if (this.supportAndroid && this.needSlider) {
const element = this.$refs['wxc-pan-item'];
- Binding.prepare && Binding.prepare({
- anchor: element.ref,
- eventType: 'pan'
- });
+ if (element) {
+ Binding.prepare && Binding.prepare({
+ anchor: element.ref,
+ eventType: 'pan'
+ });
+ }
}
}, 300)
},