I have a Vue Component, that is simple like this:
<template>
<h1>Teste</h1>
</template>
<script>
export default {
mounted() {
console.log("Component mounted.");
},
};
</script>
my app.js:
require("./bootstrap");
import { createApp } from "vue";
import ExampleComponent from "./components/ExampleComponent";
const app = createApp({});
app.component("ExampleComponent", ExampleComponent);
app.mount("#app");
and when i try to use this component in blade the component is not rendering, i try this way
<div>
<h1> <ExampleComponent></ExampleComponent> </h1>
</div>
and this way
<div>
<h1> <ExampleComponent/> </h1>
</div>
the blade is working fine, its just the Vue component that is not rendering
2
Answers
Please check if you install Vue properly in Laravel project,
double check it and also check if JS files are loading
you need to add id app
ex:
or