0

the same questions already asked here but answer do not resolve my problem

1. Laravel: vue components not rendering

2. Vue component not showing in laravel

this my home.blade.php


<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <title>Full stack blog</title>
        <style>
        </style>
    </head>
    <body>
        
        <div id="app">
        <mainapp></mainapp>   #this one show as read
        </div>
    </body>

<script src="{{mix('/js/app.js')}}"></script>
</html>

this is my app.js

require('./bootstrap');
window.Vue = require('vue')

Vue.component('mainapp',require('./components.vue/mainapp.vue').default)

const app = new Vue({
    el: '#app'
})

and this my mainapp.vue

<template>
    <div> 
        <h1>this is the frist components</h1>
    </div>
</template>

and
laravel : 8 Vue: 2.6.12

when I run npm run watch and php artisan serve

then I check in 127.0.0.1/8000

I can see this

You are running Vue in development mode. Make sure to turn on production mode when deploying for production. See more tips at https://vuejs.org/guide/deployment.html

but it does not render how can I solve this?

2
  • 1
    is this a typo?? </mainapp> should be <mainapp /> Commented Sep 14, 2020 at 16:54
  • < mainapp> added sorry i edit question Commented Sep 14, 2020 at 16:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.