[Vuejs]-Vue.js โ€“ How to use a child component inside parent component

0๐Ÿ‘

Ok got it working:

Child:

<script>
  import Vue from "vue";

  export default Vue.component('st-filter', {
    template: `<h1>This is a todo</h1>`
  })
</script>

Parent:

<template >
  <div class="st-view-wrap">
    <h1>USAGE</h1>
    <st-filter></st-filter>
  </div>
</template>

<script>
  import Vue from 'vue';
  import Filter from './shared/filter/Filter';

  export default new Vue({
    name: 'st-usage',
    data () {
      return {
        msg: 'Welcome to Your Vue.js App'
      }
    },
    components: {
      'st-filter': Filter
    }
  });
</script>

Leave a comment