From 6c1db6d841858061166799a651170f9e789e4859 Mon Sep 17 00:00:00 2001 From: ywenhao Date: Sat, 5 Jul 2025 14:57:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D[picker-view]=20year?= =?UTF-8?q?=20=E9=80=89=E5=80=BC=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/component/picker-view/picker-view.vue | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pages/component/picker-view/picker-view.vue b/pages/component/picker-view/picker-view.vue index 54ab4ad1..d067fcde 100644 --- a/pages/component/picker-view/picker-view.vue +++ b/pages/component/picker-view/picker-view.vue @@ -42,6 +42,7 @@ for (let i = 1; i <= 31; i++) { days.push(i) } + const yearIdx = years.findIndex(item => item === year) return { title: 'picker-view', years, @@ -50,18 +51,18 @@ month, days, day, - value: [9999, month - 1, day - 1], + value: [yearIdx, month - 1, day - 1], /** * 解决动态设置indicator-style不生效的问题 */ visible: true, // indicatorStyle: `height: ${Math.round(uni.getSystemInfoSync().screenWidth/(750/100))}px;` - indicatorStyle: `height: 50px;`, - // #ifdef MP-KUAISHOU - maskStyle: "padding:10px 0" - // #endif - // #ifndef MP-KUAISHOU - maskStyle: "" + indicatorStyle: `height: 50px;`, + // #ifdef MP-KUAISHOU + maskStyle: "padding:10px 0" + // #endif + // #ifndef MP-KUAISHOU + maskStyle: "" // #endif } },