Subscribe on changes!

"Date" is inferred as string when specified as one of multiple possible prop types

avatar
Sep 4th 2021

Version

3.2.8

Reproduction link

codesandbox.io

Steps to reproduce

Define props

{
  props: {
    date: [Date, Number]
  },
  setup(props) {
    // type is string | number
    props.date 
  }

What is expected?

props.date should be of type Date | number

What is actually happening?

props.date is of type string | number


This is likely related to #2668

avatar
Sep 4th 2021

i think have the same problem with defineProps, so I mentioned another PR to fixed it