Adds import
statement and component
property to current .vue single file component file.
Via:
- Placing your cursor on the component tag inside
<template />
section and triggering keybind/command pallete. - (TODO) specifying component name in command pallete.
- (TODO) import all components in file in one go.
! TODO: Currently assumes filename of component is
PascalCase.vue
and imports asPascalCase.vue
. Future release will findkebab-case.vue
orPascalCase.vue
file.
(place cursor on MyComponent
tag)
<template>
<MyComponent />
</template>
<script>
export default {};
</script>
Press keybinding (default ctrl/cmd+i)
or Command Pallete Vue: Import vue component at cursor
<template>
<MyComponent />
</template>
<script>
import MyComponent from '../../../MyComponent.vue';
export default {
components: {
EbPopper,
},
};
</script>
vue-component-importer.enableDebugMessages
: enable/disable debug messages
CtrlCmd+i
: Trigger cursor position import
Vue: Import vue component at cursor