diff --git a/examples/routers/time.vue b/examples/routers/time.vue index aa0e4217..b5449406 100644 --- a/examples/routers/time.vue +++ b/examples/routers/time.vue @@ -1,5 +1,7 @@ diff --git a/src/components/time/time.vue b/src/components/time/time.vue index 4e20669a..6150c1b5 100644 --- a/src/components/time/time.vue +++ b/src/components/time/time.vue @@ -49,6 +49,12 @@ ]; } }, + watch: { + time () { + // https://segmentfault.com/q/1010000021110866 + if (!isServer) this.setTime(); + } + }, methods: { handleClick () { if (this.hash !== '') window.location.hash = this.hash; @@ -96,4 +102,4 @@ if (this.timer) clearInterval(this.timer); } }; - \ No newline at end of file +