From 893ff90c6e21fa3a5241a8ae9b33836037cd5912 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: Thu, 29 Aug 2024 15:19:17 +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