abdulaziz
11 months ago
262
17
Vue

Trying to use Moment.js

Posted 11 months ago by abdulaziz

terminal:

npm install moment --save

app.js:

var moment = require('moment');

const app = new Vue({
    el: '#app',
    data:{
    moment: moment
   }
});

show.vue:

{{moment().format('LTS')}}

Error: Property or method "moment" is not defined on the instance but referenced during render

Am I doing something wrong?

Please sign in or create an account to participate in this conversation.