1 month ago

Error in registering a simple vue component with laravel

Posted 1 month ago by atfinho

Hey guys I'm trying to register a vue component in laravel blade and I'm getting this error

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

This is app.js


window.Vue = require('vue');
import Vue from 'vue'
import ExampleComponent from './components/ExampleComponent.vue'

Vue.component('ExampleComponent', require('./components/ExampleComponent.vue'));

const app = new Vue({
    el: '#app',
    components: { ExampleComponent },


This is my ExampleComponent.Vue

    <div class="container">
        <div class="row justify-content-center">
            <div class="col-md-8">
                <div class="card">
                    <div class="card-header">Dashboard Component</div>

                    <div class="card-body">
                        I'm an example component.

    export default {
        mounted() {
            console.log('Component mounted.')

And this is my blade

<div class="content-wrapper" id="app">

    <section class="content-header">

        {{ Breadcrumbs::render('addCustomProduct',$company) }}

    <section class="content" style="margin-top:20px;">
        <div class="row">
            <div class="container">
                <ExampleComponent> </ExampleComponent>




I don't know what's wrong is happening :(

Please sign in or create an account to participate in this conversation.