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

Error when using calc() and CSS v-bind() #5302

Closed
ota-meshi opened this issue Jan 21, 2022 · 0 comments
Closed

Error when using calc() and CSS v-bind() #5302

ota-meshi opened this issue Jan 21, 2022 · 0 comments
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: sfc-style-vars

Comments

@ota-meshi
Copy link
Member

Version

3.2.28

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Open the link to SFC playground

What is expected?

I expected the div element to be displayed.
I also expected the following CSS v-bind() to be available.

  div {
    width: calc(v-bind(a) - 3px);
  }

What is actually happening?

SyntaxError.

SyntaxError: Error parsing JavaScript expression: Identifier directly after number. (2:30)
    at Vt (https://sfc.vuejs.org/assets/vendor.4d121121.js:2:8418)
    at Tn (https://sfc.vuejs.org/assets/vendor.4d121121.js:24:697)
    at dT (https://sfc.vuejs.org/assets/vendor.4d121121.js:30:601)
    at Module.T6 [as compileScript] (https://sfc.vuejs.org/assets/vendor.4d121121.js:95:3)
    at cP (https://sfc.vuejs.org/assets/vendor.4d121121.js:609:193)
    at m0 (https://sfc.vuejs.org/assets/vendor.4d121121.js:605:7432)

It works when we change the version to v3.2.27 on Playground.

Or, if we change the CSS to the following, it will work.

  div {
    width: calc(v-bind('a') - 3px);
  }
@edison1105 edison1105 added ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. 🐞 bug Something isn't working scope: sfc-style-vars has workaround A workaround has been found to avoid the problem labels Jan 21, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Oct 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. has workaround A workaround has been found to avoid the problem 🐞 bug Something isn't working scope: sfc-style-vars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants