Commit 492f652bab92e271e67063024b91a49d7c11d0a2

Authored by 梁灏
1 parent b8509c59

sse

Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
src/components/time/time.vue
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
2 <span :class="classes" @click="handleClick">time</span> 2 <span :class="classes" @click="handleClick">time</span>
3 </template> 3 </template>
4 <script> 4 <script>
  5 + import Vue from 'vue';
  6 + const isServer = Vue.prototype.$isServer;
5 import { oneOf } from '../../utils/assist'; 7 import { oneOf } from '../../utils/assist';
6 8
7 const prefixCls = 'ivu-time'; 9 const prefixCls = 'ivu-time';
@@ -47,10 +49,14 @@ @@ -47,10 +49,14 @@
47 methods: { 49 methods: {
48 handleClick () { 50 handleClick () {
49 if (this.hash !== '') window.location.hash = this.hash; 51 if (this.hash !== '') window.location.hash = this.hash;
  52 + },
  53 + setTime () {
  54 +
50 } 55 }
51 }, 56 },
52 mounted () { 57 mounted () {
53 this.setTime(); 58 this.setTime();
  59 + if (isServer) return;
54 this.timer = setInterval(() => { 60 this.timer = setInterval(() => {
55 this.setTime(); 61 this.setTime();
56 }, 1000 * this.interval); 62 }, 1000 * this.interval);