Skip to content

Couldn't use VueJS component with "kebab-case" in HTML template #490

Answered by adamwathan
sarukomine asked this question in Help
Discussion options

You must be logged in to vote

Lowercase "dialog" is a standard HTML element so Vue doesn't think you are trying to use a component when you write it that way. If you want to use kebab case, you'll have to alias it to a different name when registering the component in your script block:

<template>
  <ui-dialog>
    ...
  </ui-dialog>
</template>

<script>
import { Dialog } from "@headlessui/vue"

export default {
  components: {
    UiDialog: Dialog
  }
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sarukomine
Comment options

Answer selected by sarukomine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants