[Vuejs]-How do I use a component in a vue route?

0👍

You need to register the <channel-card> component and add it to components in the script section of home.vue:

home.vue

<template>
  <div class="home">
    <main class=" bg-white w-full h-100vh shadow-md p-2">
      <channel-card></channel-card>
    </main>
  </div>
</template>

<script>
import channelCard from './channel-card.vue';

export default {
  name: 'home',
  components: { channelCard },
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  }
}
</script>

Leave a comment