moment is not defined vuejs code example
Example: 'moment' is not defined export default vue
<template>
<div>
<p>{{ formattedDate }}</p>
</div>
</template>
<script>
import moment from 'moment';
export default {
computed: {
formattedDate() {
return moment(this.givenDate).format('YYYY');
}
},
//
}
</script>