viruscamp / vue-cli-plugin-auto-import-tags

Auto import vue components by tags. Should be used along with using [babel-plugin-import](https://github.com/ant-design/babel-plugin-import) or [babel-plugin-transform-imports](https://github.com/viruscamp/babel-plugin-transform-imports/tree/babel-7).

Repository from Github https://github.comviruscamp/vue-cli-plugin-auto-import-tagsRepository from Github https://github.comviruscamp/vue-cli-plugin-auto-import-tags

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>