P
P
Pavel K2021-04-04 20:41:32
Laravel
Pavel K, 2021-04-04 20:41:32

Why is the Vue template not rendering?

Greetings!
Given: Laravel8, Vue 3 and Blade templates.
I use a little-familiar admin panel (which has a lot of things on Vue), in which I try to display the contents of the View in which my Vue component is using its regular means.

mycomponent.blade.php
<mycomponent></mycomponent>

mycomponent.vue

<template>
  <div>
    It`s my component 
  </div>
</template>

<script>
  export default {
    mounted() {
      console.log("My component mounted...");
    }
  };
</script>


Well, in app-admin.js
Vue.component('mycomponent', require('./components/mycomponent.vue').default);


At the same time, instead of a template, the output is just a comment "", but the console displays "My component mounted ..."

Tell me, please, what did I do wrong and what should I do?
PS npm run watch I run, there are no errors anywhere.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question