About vue component Name Casing
viruscamp opened this issue · comments
Due to https://vuejs.org/v2/guide/components-registration.html#Name-Casing
It's ok to write:
<template>
<div>
<a-button />
<AButton />
</div>
</template>
<script>
import { Button } from 'your-own-button'
export default {
components: {
AButton: Button
}
}
</script>
But it fails with:
<template>
<div>
<a-button /><!-- works -->
<AButton /><!-- fails -->
</div>
</template>
<script>
import { Button } from 'your-own-button'
export default {
components: {
'a-button': Button
}
}
</script>
If you use this plugin, the second code will act as:
<template>
<div>
<a-button /><!-- works as 'your-own-button' -->
<AButton /><!-- also works, but it's from 'ant-design-vue' -->
</div>
</template>
<script>
import { Button } from 'your-own-button'
import { AButton } from 'ant-design-vue'
export default {
components: {
'a-button': Button,
'AButton': AButton
}
}
</script>