Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
iiop123 authored Nov 11, 2022
1 parent 95e764f commit c121a9e
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<script>
let d=new Date()
export default{
data(){
return{
weekday:["周日",
"周一",
"周二",
"周三",
"周四",
"周五",
"周六"],
time:''
}
},
methods:{
time_com(){
this.time=new Date().toLocaleTimeString()}
},
created() {
setInterval(this.time_com, 1000);
},
beforeDestroy() {
clearInterval(this.time);
},
computed:{
xingqi(){
return d.toLocaleDateString()+" "+this.weekday[d.getDay()]
}
}
}
</script>

<template>
<div class="time">{{time}}</div>
<div class="xingqi">{{xingqi}}</div>
</template>

<style>
@import url(https://fonts.googleapis.com/css2?family=Roboto:ital,wght@1,900&display=swap);
.time{
font-size: 13rem;
font-family: 'Roboto', sans-serif;
margin-top: 120px;
text-align: center;
}
.xingqi{
position: fixed;
right: 0px;
margin-top: 5%;
font-size: 450%;
font-weight: 300;
}
</style>
4 changes: 4 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')

0 comments on commit c121a9e

Please sign in to comment.