Skip to content

Is there any reason for removing filter pipeline #1862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
axetroy opened this issue Aug 15, 2020 · 2 comments
Closed

Is there any reason for removing filter pipeline #1862

axetroy opened this issue Aug 15, 2020 · 2 comments

Comments

@axetroy
Copy link

axetroy commented Aug 15, 2020

Version

3.0.0-rc.5

Reproduction link

https://none.com

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.

@syuilo
Copy link
Contributor

syuilo commented Aug 15, 2020

See vuejs/rfcs#97

@axetroy
Copy link
Author

axetroy commented Aug 15, 2020

Thx for you reply @syuilo

@axetroy axetroy closed this as completed Aug 15, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Nov 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants