Subscribe on changes!

Regression: union typed prop has wrong type in setup

avatar
Mar 4th 2021

Version

3.0.7

Reproduction link

https://codesandbox.io/s/union-prop-307-rixqq?file=/src/index.ts

image

Steps to reproduce

3.0.6(ok) https://codesandbox.io/s/union-prop-306-nxhiw?file=/src/index.ts:0-545 3.0.7(not ok) https://codesandbox.io/s/union-prop-307-rixqq?file=/src/index.ts

What is expected?

Type shouldn't union with xxx & {}

What is actually happening?

Type is broken


It possibly has the same reason of https://github.com/vuejs/vue-next/pull/3119

avatar
Mar 4th 2021

I'm sure this can be fixed in #3119

avatar
Mar 7th 2021

Workaround

prop: xxx

=>

prop: {
  type: xxx,
  default: undefined
}