| | |
| | | <div class="home-left"> |
| | | <!--时间 天气--> |
| | | <div class="time-weather"> |
| | | <div class="time">2025.03.04 15:30:00</div> |
| | | <div class="time">{{ time }}</div> |
| | | <div class="line"></div> |
| | | <div class="weather"> |
| | | <img src="@/assets/images/tq.png" alt="" /> |
| | |
| | | <script setup> |
| | | import OverviewNext from './OverviewNext.vue'; |
| | | import InspectionRaskDetails from './InspectionRaskDetails.vue'; |
| | | import dayjs from 'dayjs'; |
| | | |
| | | |
| | | const time = ref(''); |
| | | const updateTime = () => { |
| | | time.value = dayjs().format('YYYY.MM.DD HH:mm:ss'); |
| | | }; |
| | | onMounted(() => { |
| | | updateTime(); // 立即执行一次 |
| | | time.value = setInterval(updateTime, 1000); |
| | | }); |
| | | onUnmounted(() => { |
| | | if (time.value) { |
| | | clearInterval(time.value); |
| | | time.value = null; |
| | | } |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |