Natural Vue defineProps

c5n8

c5n8

Posted on June 20, 2023

Natural Vue defineProps

What if we have something like this?

const props = defineProps(
  /**
   * @param {{
   *   foo: boolean,
   *   bar: number,
   * }} props
   */
  (
    props = {
      foo: false,
      bar: 0,
    }
  ) => props
)
Enter fullscreen mode Exit fullscreen mode

in typescript

const props = defineProps(
  (
    props: {
      foo: boolean,
      bar: number,
    } = {
      foo: false,
      bar: 0,
    }
  ) => props
)
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
c5n8
c5n8

Posted on June 20, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Natural Vue defineProps
vue Natural Vue defineProps

June 20, 2023