From 277d6652893fcc10fb6827b62ef16fe2910a525c Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期五, 15 十二月 2023 16:58:25 +0800 Subject: [PATCH] 强制更新功能 --- uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue index bd96488..8769e83 100644 --- a/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue +++ b/uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue @@ -450,6 +450,10 @@ right.setDate(this.$refs.right.nowDate.fullDate) }, platform() { + if(typeof navigator !== "undefined"){ + this.isPhone = navigator.userAgent.toLowerCase().indexOf('mobile') !== -1 + return + } const { windowWidth } = uni.getSystemInfoSync() this.isPhone = windowWidth <= 500 this.windowWidth = windowWidth @@ -460,7 +464,9 @@ } this.platform() if (this.isPhone) { - this.$refs.mobile.open() + setTimeout(() => { + this.$refs.mobile.open() + }, 0); return } this.pickerPositionStyle = { -- Gitblit v1.9.2