How To Install Vue 3 in Laravel 8 From Scratch (ok)
https://techvblogs.com/blog/how-to-install-vue3-laravel
C:\xampp\htdocs\marinesTeam26\resources\js\app.js
require('./bootstrap')
import { createApp } from 'vue'
import Welcome from './components/Welcome'
const app = createApp({})
app.component('welcome', Welcome)
app.mount('#app')C:\xampp\htdocs\marinesTeam26\resources\js\Welcome.vue
<template>
<h1>{{ title }}</h1>
</template>
<script>
export default {
setup: () => ({
title: 'How To Install Vue 3 in Laravel 8 From Scratch'
})
}
</script>C:\xampp\htdocs\marinesTeam26\resources\views\welcome.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>Laravel</title>
<style>
body {
font-family: 'Nunito', sans-serif;
}
</style>
</head>
<body class="antialiased">
<div id="app">
<div class="relative flex items-top justify-center min-h-screen bg-gray-100 sm:items-center py-4 sm:pt-0">
<welcome />
</div>
</div>
<script src="{{ mix('js/app.js') }}"></script>
</body>
</html>C:\xampp\htdocs\marinesTeam26\package.json
Last updated
Was this helpful?