0

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>

2
  • 1
    if you callled to your componentOneway then use it as <oneway>, to use it as <one-way> his name should be OneWay Commented Jan 14, 2020 at 12:20
  • I did it, it's shown for first time but when I refresh the page I have the error again :( Commented Jan 14, 2020 at 12:37

2 Answers 2

1

You must import the component as OneWay not Oneway

Sign up to request clarification or add additional context in comments.

Comments

1

For alternative answer , you can define component name as below

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.