vue plugin timer
An easy way to use setTimeout and setInterval.
Install
npm i vue-plugin-timer
Usage
;; Vue;
Then in Vue lifecycle hooks, use this.$setTimeout
this.$setInterval
this.$clearTimeout
this.$clearInterval
replace the methods of window
.
All timers will be cleared when component destroyed.
License
Copyright © 2018-present wmzy. This source code is licensed under the MIT license found in the LICENSE.txt file.