0.2.0 • Published 5 years ago

vue-moments-ago v0.2.0

Weekly downloads
336
License
MIT
Repository
github
Last release
5 years ago

vue-moments-ago

A Vue.js component for updating human readable time format.

eg:

posted 2 minutes ago

this is automatically updated without any refresh. Checkout this Live Demo

Install

npm install vue-moments-ago

and in your component file script tag,

import VueMomentsAgo from 'vue-moments-ago'

export default{
  components: {
    VueMomentsAgo
  }
}

in the template, use:

<vue-moments-ago prefix="posted" suffix="ago" date="2018-05-02T20:22:22.285Z" lang="en"></vue-moments-ago>

result:

 posted 2 minutes ago

Props

PropsRequiredTypeDefinition
prefixfalseStringAny prefix string you want to add to the output
suffixfalseStringAny suffix string you want to add to the output
datetrueStringThe date is in ISO 8601 (default format of moment.js)
languagefalseStringdefault is "en"

Support Language

We support English, Korean and Japanese. y Language options are available. default value is "en".

en kr jp