Cannot activate/import #moment into #uibuilder

I could not use $moment functions even tho I loaded vue-moment.js with :

<script src="../uibuilder/vendor/vue-moment/dist/vue-moment.js"></script>

and activated the plugins in index.js with :-
Vue.use('vue-moment');

Any help is appreciated ...

When loading random VueJS components or extensions, I generally look for the instructions that relate to using it from a CDN. Doing an npm install (e.g. installing from uibuilder) is quite similar.

The following gives some clues in this case:

Looks like you also have to load moment separately. Also, you wouldn't normally need to do a Vue.use when loading from a script tag.

In addition, you may not need vue-moment at all. Unless you wan to use moment as a Vue filter, why not just use the moment library directly in your own code?

Either way, don't forget to check your browser's development console (F12 normally) for errors.

2 Likes

Ok thanks, loaded vanila moment.js with script tag and got it working ....

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.