Answer the question
In order to leave comments, you need to log in
How to make a filter in template?
There is this code:
<template>
<ul>
<li v-for="item in items">
<span>{{ item.date }}</span>
</li>
</ul>
</template>
Answer the question
In order to leave comments, you need to log in
With the help of moment.js: https://codepen.io/anon/pen/aKgLXP
The only thing, if you build using webpack, then you need to remove unnecessary locales from the build, otherwise everything will be very bold. More or less like this:
const webpack = require('webpack');
....
module.exports = {
...,
plugins: [
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /ru/),
],
...
}
Computed
property or directives https://ru.vuejs.org/v2/guide/custom-directive.html
Computed property advice sucks, use https://en.vuejs.org/v2/guide/filters.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question