A timeago component for Vue.
Install
$ npm install --save vue-timeagoIt's also available on NPMCDN: npmcdn.com/vue-timeago…
Usage
import VueTimeago from 'vue-timeago'
Vue.use(VueTimeago, {
name: 'timeago', // component name, `timeago` by default
locale: 'en-US',
locales: {
'en-US': require('vue-timeago/locales/en-US.json')
}
})Then in your lovely component:
A very basic demo: egoistian.com/vue-timeago
i18n support
For all supported languages, see /locales, feel free to submit a Pull Request to help us support more languages!
Development
I use rolling to build the cjs version bundle, and use vbuild to build the example. Install them globally and then see the npm scripts.
License
MIT © EGOIST