How does vue achieve a function similar to the dynamic display of time by an electronic watch?

the business scenario is shown in the figure, and the current date and time is recorded after clicking. How to achieve it?

< hr >

by the way, it"s dynamic, like an electronic watch.

Mar.01,2021

getData() {
    var t = new Date();//datedate
    var h = t.getHours();
    var m = t.getMinutes();
    var s = t.getSeconds();
    this.time = h + ':' + m + ':' + s;
    let _this = this;
    setTimeout(() => {
      _this.getData();
    }, 1000);
},
The time defined by

is put in the desired location


is very simple
Click var now = new Date () (to convert to the format you need) save this now (where you need it)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2c1d7-2baf1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2c1d7-2baf1.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?