当前位置: 代码迷 >> 综合 >> ts Types of property ‘flex Direction‘ are incompatible.
  详细解决方案

ts Types of property ‘flex Direction‘ are incompatible.

热度:25   发布时间:2023-12-12 01:04:56.0

ts Types of property ‘flex Direction’ are incompatible.

problem

reac + ts 定义样式object

const wrapStyle= {
    display: 'flex',justifyContent: 'center',alignItems: 'center',flexDirection: 'column'
}

vscode编辑器提示:
ts Types of property 'flex Direction' are incompatible.

solution

flexDirection: 'column'
改为
flexDirection: 'column' as 'column'

  相关解决方案