hassan-pudineh
hassan-pudineh

Reputation: 82

Use a component inside another component

I have set the "name" property in Oneway.vue but I can't use the component and I got this error: did you register the component correctly? For recursive components, make sure to provide the "name" option

import Oneway from '../Flight/Oneway';
export default {
  name:'FlightResult',
  components:{
    Oneway
  }
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<template>
    <div>
        <one-way></one-way>
    </div>
</template>

Upvotes: 0

Views: 81

Answers (2)

Jack jdeoel
Jack jdeoel

Reputation: 4584

For alternative answer , you can define component name as below

import Oneway from '../Flight/Oneway';
export default {
  name:'FlightResult',
  components:{
    'one-way': Oneway
  }
}

Upvotes: 1

Adri HM
Adri HM

Reputation: 3100

You must import the component as OneWay not Oneway

Upvotes: 1

Related Questions