Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悶 vue-component-meta is broken #2256

Closed
jd-solanki opened this issue Dec 26, 2022 · 1 comment
Closed

馃悶 vue-component-meta is broken #2256

jd-solanki opened this issue Dec 26, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jd-solanki
Copy link
Contributor

jd-solanki commented Dec 26, 2022

I was updating the docs for Anu and found that there's something wrong with the meta generation and later found volar can't get the correct meta for example component in this repo.

<script lang="ts" setup>
import { StringEmpty, StringRequired, StringUndefined } from './my-props';

defineProps({
  foo: {
    type: String,
    required: true
  },
  bar: {
    type: String,
    default: 'BAR'
  },
  baz: {
    type: String
  },
  xfoo: StringRequired,
  xbar: StringEmpty,
  xbaz: StringUndefined,
  /**
   * The hello property.
   *
   * @since v1.0.0
   */
  hello: {
    type: String,
    default: 'Hello'
  },
  numberOrStringProp: {
    type: [Number, String],
    default: 42
  },
  arrayProps: {
    type: Array,
    default: () => [42, 43, 44]
  }
})
</script>

In the above example component of this repo, baz should have required: false but component meta shows it as required:
image

@jd-solanki
Copy link
Contributor Author

Moreover, it doesn't return the default value as well 馃

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants