Browse Source

优化日期组件

master
LiLongLong 3 months ago
parent
commit
616959150d
  1. 6
      src/pages/Index/Settings/Device.vue

6
src/pages/Index/Settings/Device.vue

@ -5,6 +5,7 @@
<el-date-picker
class="date-input"
v-model="time"
:key="pickerKey"
type="datetime"
placeholder="修改日期与时间"
format="YYYY-MM-DD HH:mm:ss"
@ -233,6 +234,7 @@ const settings = ref<Settings>({
//
const currentDate = ref(new Date())
const time = ref('00:00:00')
let pickerKey = ref(0)
// const dateFormats = ['MM.dd.yyyy', 'dd.MM.yyyy', 'yyyy.MM.dd']
// const selectedDateFormat = ref(dateFormats[2])
@ -294,6 +296,8 @@ const updateSetting = async (key: string, value: any) => {
//
clearInterval(intervalId.value)
res = await setDateAndTime(value)
//KEYdate-pickerfocus
pickerKey.value = new Date().getTime()
//
startTimer()
break
@ -482,7 +486,7 @@ const resumeTimer = () => {
<style scoped lang="less">
.device-management {
width: 100%;
height: 87vh;
height: 91.5vh;
padding: 20px;
box-sizing: border-box;
background-color: #f5f7fa;

Loading…
Cancel
Save