From f915fc233349839618c89b3a8c0d49322dc932a1 Mon Sep 17 00:00:00 2001 From: rex Date: Sun, 3 Feb 2019 21:26:32 +0800 Subject: [PATCH] =?UTF-8?q?[bugfix]=20Area:=20=E4=BF=AE=E5=A4=8D=E7=89=B9?= =?UTF-8?q?=E6=AE=8A=E6=83=85=E5=86=B5=E4=B8=8B=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix #1215 --- packages/picker-column/index.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/picker-column/index.ts b/packages/picker-column/index.ts index d316eed7..8407281f 100644 --- a/packages/picker-column/index.ts +++ b/packages/picker-column/index.ts @@ -30,17 +30,15 @@ VantComponent({ currentIndex: 0 }, - created() { + beforeCreate() { const { defaultIndex, initialOptions } = this.data; - this.set( - { - currentIndex: defaultIndex, - options: initialOptions - }, - () => { - this.setIndex(defaultIndex); - } - ); + + this.set({ + currentIndex: defaultIndex, + options: initialOptions + }).then(() => { + this.setIndex(defaultIndex); + }); }, computed: {