Unknown Custom Element

Posted on  by admin
Modified4 years, 9 months ago.

i had this error . my add-video.blade.php. Laravel 5.4 project .I coded same code for different components.Same code works other component.I think have not syntax error.but i didn't find my fault.I hope shared piece of code helpful for you.

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

11 gold badge66 silver badges1818 bronze badges. 1818 bronze badges. Actually, html tags are not case-sensitive, everything is lowered.

Use hyphen notation instead to have an equivalent to an addVideo in your template (as long as it is in a .php or an .html file):.

22 gold badges2727 silver badges3737 bronze badges.

3737 bronze badges. 版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 .

本文链接:https://blog.csdn.net/lw112190/article/details/124455188.

©️2022 CSDN皮肤主题:创作都市 设计师:CSDN官方博客返回首页.

You've created this amazing Vue component, and you're trying to use it within another component. Then you get this terrible error:. [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

Don't worry, I'll show you exactly how to fix this.
Lucien ChardonLucien Chardon
421
2

Regular HTML tags like

,

, or

don't need to be registered. Every browser knows how to render these, so Vue doesn't have to do anything special to get them to work.

However, when you write your own custom Vue component, Vue needs to know about it first.

You need to tell Vue which component it needs to render when you use in your template.

You do this through registering the component.

But there are 2 different ways you can register a component — global and local registration.
1

Let's take a look at each of them, and figure out which one you should be using when.

You can make your component available to your whole app using global registration:.

This line needs to be placed where you do all of your Vue setup. This is where you import vue and create the Vue app using new Vue().

It's likely in a file called main.js or something similar.

If you're using Vue CLI, then you would modify the file main.js to look like this:.

Now, inside of any other Vue component you can just write out the component name in the template and it will work!

ittusittus
19.9k1

Components like a Button or Input, for example. You only need to register the component one time, which can make things easier.

As you'll see, local registration requires a little more typing, but it's worth it.

Not the answer you're looking for? Browse other questions tagged vue.jsvuejs2vuetify.jsvue-clivue-cli-3 or ask your own question.