2
votes

I got a simple single-file component called "MobileApps.vue":

<template>
    <div class="grey-bg about-page">
        <p>{{ greetings }}</p>
    </div>
</template>

<script>
    export default {
        name: 'Home',
        data() {
            return {
                greetings: "Hello"
            }
        }
    };
</script>

And registering it:

const app = new Vue({
el: '#app',
router,
components: {
    Home,
    About,
    Gas,
    Electricity,
    Contacts,
    Electricity_info,
    Gas_info,
    MobileApps
},
data: {
},
created() {
},
destroyed() {

},
mounted() {
    let mySVGsToInject = document.querySelectorAll('img.inject-me');
    SVGInjector(mySVGsToInject);
},
methods: {
}

});

When I'm trying to open the HTML file with <MobileApps> component I'll get an error:

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

But even when I provide a name, nothing happens.

1
Does this answer your question? Vue component name must be lowercase?underscore_d
@underscore_d nope.Ashen One
Weird, because you accepted an answer that indicates you had the same root cause, as far as I can read.underscore_d
@underscore_d Sry, my bad. Your right.Ashen One

1 Answers

2
votes

Try with cabeb-case format <mobile-apps> like :

 <mobile-apps></mobile-apps>