vue-moment
vue-moment copied to clipboard
Filters being deprecated in Vue 3
Will this still work in Vue 3 with filters being deprecated?
https://v3.vuejs.org/guide/migration/filters.html#overview
eek! probably not then. I will see if I can refactor to move to something a bit more Vue 3 friendly, like using the Composition API
@joshmakar I have made a little Vue 3 repo here to test how we could include moment in a plugin
https://github.com/BrockReece/vu3-moment
Any thoughts?
@BrockReece I haven't started using Vue 3 yet but didn't want to start using a package that may become obsolete when we move our app to Vue 3. So I don't know much about Vue 3 at the moment. I did find a method to attach Moment to our Vue instance for the time being https://stackoverflow.com/questions/34308004/moment-js-with-vuejs/43113066#43113066
Not sure what the pros/cons would be of incorporating it this way though.
Tnx for guidance @joshmakar :) , was afraid am at dead end for vue 3 and moment.js :)
npm install moment --save
Then in any component
import moment from 'moment'
...
export default {
created: function () {
this.moment = moment;
},
...
<div class="comment-line">
{{moment(new Date()).format('DD.MM.YYYY [ ] HH:mm')}}
</div>
thanks, @songoo this method final worked
Check https://github.com/brockpetrie/vue-moment/pull/166