Closed
Description
Version
3.0.0-rc.5
Reproduction link
Steps to reproduce
none
What is expected?
none
What is actually happening?
none
Since vue@3 removes the pipeline, it is recommended to use computed
This confused me.
Using filter in vue@2.x can facilitate template rendering
2.x
<template>
<div> {{ createdAt | time_format }} </div>
</template>
<script>
export default {
{
filters: {
format (val) {
return moment(val).format('YYYY-MM-DD hh:mm:ss')
}
}
}
}
</script>
It allows me to format the time on every page instead of importing it separately
3.x
<template>
<div> {{ createdAt_format }} </div>
</template>
<script>
export default {
{
computed: {
createdAt_format () {
return moment(this.createdAt).format('YYYY-MM-DD hh:mm:ss')
}
}
}
}
</script>
Using computed, I have to define the method how to format the time on every component.
I want to know why this feature was removed, is it because of tree-shake considerations?
Can it be described in the document?
Thx for the great job and feel free to close this.
Metadata
Metadata
Assignees
Labels
No labels