Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filters being deprecated in Vue 3 #144

Open
joshmakar opened this issue Jul 22, 2020 · 6 comments
Open

Filters being deprecated in Vue 3 #144

joshmakar opened this issue Jul 22, 2020 · 6 comments

Comments

@joshmakar
Copy link

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

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

@BrockReece
Copy link
Collaborator

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
Copy link
Collaborator

BrockReece commented Jul 23, 2020

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

@joshmakar
Copy link
Author

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

@songoo
Copy link

songoo commented Jan 4, 2021

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>

@JayShamnani
Copy link

thanks, @songoo this method final worked

@rah-emil
Copy link

Check #166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants