Skip to content

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

@Pentadome

Description

@Pentadome

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>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions