Currently, I am utilizing Vue.js 2+ version and have implemented a date formatting filter to meet my needs. However, I recently found out that Vue 3 has removed the filter functionality in favor of using computed properties or methods. My dilemma now is how to create a solution that works for both versions.
The date filter I created for Vue.js 2
<ul>
<li v-for="(info, index) in data">
{{info.time.data | Filter}}
<li>
<ul>
Filter function :
filters: {
Filter(date){
return moment.unix(date).utc().format('HH:mm a');
}
},
How can I write a method that is compatible with both Vue.js 2 and 3?