Skip to content

Commit 8c8a9f9

Browse files
author
Michael William Le Nguyen
committed
Add time display logic
1 parent f3c8114 commit 8c8a9f9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/App.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</div>
1616
<div class="row" style="height: 15%; padding-top: 1vw;">
1717
<div class="col-md-12">
18+
<h2 style="text-align: left;">{{ time }}</h2>
1819
</div>
1920
</div>
2021
</div>
@@ -28,7 +29,15 @@ import './app.css'
2829
@Component({
2930
components: {}
3031
})
31-
export default class App extends Vue {}
32+
export default class App extends Vue {
33+
private time: string = ''
34+
35+
private mounted (): void {
36+
setInterval(() => {
37+
this.time = new Date().toLocaleString()
38+
}, 1000)
39+
}
40+
}
3241
</script>
3342

3443
<style>
@@ -37,6 +46,10 @@ h1 {
3746
text-align: left;
3847
}
3948
49+
h2 {
50+
font-size: 2.5em;
51+
}
52+
4053
#app {
4154
font-family: 'Avenir', Helvetica, Arial, sans-serif;
4255
-webkit-font-smoothing: antialiased;

0 commit comments

Comments
 (0)