-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
css style variable v-bind does not support complex expression with () in expression #5109
Comments
You need to wrap the expression with quotes as said in https://v3.vuejs.org/api/sfc-style.html#state-driven-dynamic-css |
recommending the usage of v-bind( '(a+b) + "px"' ) over v-bind( (a + b) + 'px' ) misses the point of this issue. it will be interesting to get some more feedback why there is no place to address what is pointed in this issue. A fix can still be done with an improved regexp expression ( no need for ast or a custom parser as mentioned in the original RFC) thanks to @edison1105 and his related PR The docs and the implementation are not consistent, in this issue we should either address the following
and more community feedback is welcomed @Justineo can you please reopen this issue so we can be have some more community feedback. edit: removed the usage of the word "silly" |
Version
3.2.26
Reproduction link
sfc playground
Steps to reproduce
use ) in the v-bind expression to break parsing
passing expression
failing expression
What is expected?
the whole expression in v-bind should be extracted as the value for the css variable
What is actually happening?
regexp extraction fails when ) is encountered in the v-bind expression. (regexp based extraction)
The text was updated successfully, but these errors were encountered: