vue-moment icon indicating copy to clipboard operation
vue-moment copied to clipboard

Filters being deprecated in Vue 3

Open joshmakar opened this issue 5 years ago • 6 comments

Will this still work in Vue 3 with filters being deprecated?

https://v3.vuejs.org/guide/migration/filters.html#overview

joshmakar avatar Jul 22 '20 14:07 joshmakar

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

BrockReece avatar Jul 22 '20 16:07 BrockReece

@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 avatar Jul 23 '20 15:07 BrockReece

@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.

joshmakar avatar Jul 24 '20 19:07 joshmakar

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 [&nbsp;] HH:mm')}}
</div>

songoo avatar Jan 04 '21 22:01 songoo

thanks, @songoo this method final worked

JayShamnani avatar May 20 '21 08:05 JayShamnani

Check https://github.com/brockpetrie/vue-moment/pull/166

rah-emil avatar May 12 '22 11:05 rah-emil