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