Type '{ flexDirection: string; }' is not assignable to type 'StyleValue'
Vue version
3.2.4
Link to minimal reproduction
Steps to reproduce
Set style using attribute binding: :style="{ ... flexDirection: 'row' | 'column', ... }"
What is expected?
No error
What is actually happening?
Type '{ flexDirection: string; }' is not assignable to type 'StyleValue'
System Info
No response
Any additional comments?
No response
- The Playground doesn't show Type information so it's not suited to reproduce the supposed issue.
- The reproduction steps are not clear.
- It's not clear when and by what the error is being raised - Volar in the IDE? running vue-tsc? Vue CLI?
Please provide a fully runnable reproduction demonstrating the problem.
as a hint: maybe all you need is as const
?
<div :style="{display: 'flex', flexDirection: 'row'} as const">