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

Type '{ 'min-width': string; }' is not assignable to type 'StyleValue | undefined'. (Typescript) #4552

Closed
Pentadome opened this issue Sep 10, 2021 · 3 comments

Comments

@Pentadome
Copy link
Contributor

Version

3.2.11

Reproduction link

sfc.vuejs.org/

Steps to reproduce

Set style using attribute binding:
:style="{ 'min-width': cellWidth }"
cellWidth is a string.

What is expected?

No error.

What is actually happening?

Error:
Type '{ 'min-width': string; }' is not assignable to type 'StyleValue | undefined'.
Object literal may only specify known properties, and ''min-width'' does not exist in type 'CSSProperties | StyleValue[]'.


I noticed that in the interface StandardLonghandProperties<TLength = string | 0> "min-width" is not defined, but in StandardLonghandPropertiesHyphen<TLength = string | 0> it is. Maybe StyleValue should extend the interface CSS.PropertiesHyphen<TLength = string | 0>

@posva
Copy link
Member

posva commented Sep 10, 2021

cc @johnsoncodehk I suppose

@vaaski
Copy link

vaaski commented Dec 11, 2021

I am running into a similar issue with custom css properties, I believe this is related.

image

@victorz
Copy link

victorz commented Oct 20, 2022

I am running into a similar issue with custom css properties, I believe this is related.

image

Also running into this problem. Can't declare/manipulate CSS variables with an attribute binding.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants