From 805d426dca575dc66c7ee1acade53ecc15ee4b71 Mon Sep 17 00:00:00 2001 From: rex Date: Thu, 12 Nov 2020 22:23:49 +0800 Subject: [PATCH] fix(picker): recover emit (#3755) fix #3749 --- packages/picker/index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/packages/picker/index.ts b/packages/picker/index.ts index deeac83e..755349fc 100644 --- a/packages/picker/index.ts +++ b/packages/picker/index.ts @@ -53,6 +53,21 @@ VantComponent({ return Promise.all(stack); }, + emit(event: WechatMiniprogram.TouchEvent) { + const { type } = event.currentTarget.dataset; + if (this.simple) { + this.$emit(type, { + value: this.getColumnValue(0), + index: this.getColumnIndex(0), + }); + } else { + this.$emit(type, { + value: this.getValues(), + index: this.getIndexes(), + }); + } + }, + onChange(event: WechatMiniprogram.CustomEvent) { if (this.simple) { this.$emit('change', {