Skip to content

Instantly share code, notes, and snippets.

@matsieftw
Created November 5, 2020 20:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matsieftw/5d14024723adbcb7361ad435f6ee354a to your computer and use it in GitHub Desktop.
Save matsieftw/5d14024723adbcb7361ad435f6ee354a to your computer and use it in GitHub Desktop.
Barrel Exporting Not Working for Vue Components
// components/header/ComponentC.vue -- sibling component that imports from barrel
import { ComponentA, ComponentB } from '~/components`
// importing from the barrel results in a component registration error
// importing the files directly works fine
// components/index.js -- component barrel export file
// header components
import ComponentA from './header/ComponentA.vue'
import ComponentB from './header/ComponentB.vue'
import ComponentC from './header/ComponentC.vue'
export { ComponentA, ComponentB, ComponentC }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment