Answer the question
In order to leave comments, you need to log in
How to solve the problem of Unknown custom element:?
Began to study vue
prescribed
Vue.component('example-component', require('./components/ExampleComponent.vue'));
const app = new Vue({
el: '#app'
});
<div id="app">
<example-component></example-component>
</div>
<template>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-8">
<div class="card card-default">
<div class="card-header">Example Component</div>
<div class="card-body">
I'm an example component.
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
mounted() {
console.log('Component mounted.')
}
}
</script>
Answer the question
In order to leave comments, you need to log in
Where have you ever seen such a connection of components, as you have?
let ExampleComponent = require('./components/ExampleComponent.vue')
Vue.component(ExampleComponent.name, ExampleComponent);
const app = new Vue({
el: '#app'
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question