Skip to content
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

Filter not recognized when filtered value contains a '/' #4415

Closed
adriaanzon opened this issue Dec 8, 2016 · 1 comment
Closed

Filter not recognized when filtered value contains a '/' #4415

adriaanzon opened this issue Dec 8, 2016 · 1 comment

Comments

@adriaanzon
Copy link

Vue.js version

2.1.x

Works fine in 2.0.x

Reproduction Link

https://jsbin.com/fuxitojugu/edit?html,console,output

Steps to reproduce

Divide a number using the / operator, then apply a filter to it.

{{ price / 100 | currency }}

What is Expected?

This divided number gets filtered, just like with other arithmetic operators.

What is actually happening?

Get this error:

"[Vue warn]: Property or method "currency" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.

"currency" is the name of the filter here, but it got recognized as a property or keyword, not as a filter.

I think, as of this commit 38b8cfd, the expression gets recognized as a regular expression because it contains a /.

@LinusBorg
Copy link
Member

As a quick workaround: {{ (price / 100) | currency }}works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants