[Vuejs]-Import vue component using web pack

0πŸ‘

βœ…

  • Your index.vueβ€˜s script tag should include the content of your components/index.js file.
  • Your index component should import the Ch component and use it in it’s Vue definition
  • Your index template should have a single DOM element wrapping all else

<template>
  <div>
    <ch></ch>
  </div>
</template>

<script>
  import Ch from '../components/ch';

  export default {
    // your index component vue here

    components: { Ch }

  };
</script>

0πŸ‘

export default {
  components: { Index, Ch }
}

Must be called in order to grab the component(s).

Leave a comment