investHome4.js 362 B

12345678910111213141516171819202122232425
  1. let app = new Vue({
  2. el: '#app',
  3. data () {
  4. return {
  5. time: '',
  6. timer: '',
  7. }
  8. },
  9. created () {
  10. this.time = formatDate()
  11. this.timer = setInterval(() => {
  12. this.time = formatDate()
  13. }, 1000)
  14. },
  15. beforeDestroy () {
  16. if (this.timer) {
  17. clearInterval(this.timer);
  18. }
  19. },
  20. mounted () {
  21. },
  22. methods: {
  23. },
  24. })