If you are using Laravel 8 PHP framework and want to install Vue.js here is how you can do it.
- Run command: npm install --save vue
- Add below to resources/js/app.js:
window.Vue = require('vue'); Vue.component('example-component', require('./components/VueComponent.vue').default); const app = new Vue({ el: '#app', });
- Create your component: VueComponent.vue
<template> <div>Testing vue with Laravel 8</div> </template> <script> export default { mounted() { console.log("Testing vue with Laravel 8"); }}; </script>
- In the head section of resources/views/layouts/app.blade.php add <script src="{{ asset('js/app.js') }}" defer></script> and add id="app" to <body>
- Add or main in your layout file (resources/views/layouts/app.blade.php)
- Add <example-component /> to your view
- Now runnpm run dev, in devtools you should see the console log.
More Posts related to PHP,- PHP drag and drop file upload tutorial using dropzone.js
- Copy file from one directory to other in Php
- PHP Base64 encoding decoding a variable
- macOS - cannot calculate MAC address: Using fd 9 hv_vm_create HV_ERROR [PHP XAMPP]
- Upload Pdf file using PHP Script
- Call PHP function on Button click using jquery ajax
- PHP Code for sending Emails
- PHP header location function not called
- Delete file using PHP code : unlink()
- PHP Warning: Cannot modify header information - headers already sent
- Failed to load resource: net::ERR_CACHE_MISS PHP
- Upload docx file using PHP script
- PHP 301 Redirect Permanently
- PHP Script to Upload Images to Server
- Installing vue.js in Laravel 8
- Remove URL Forward Slash Before Single or Double quotes in php.ini
- How to destroy PHP session()
- PHP Fatal error : Call to a member function bind_param() on a non-object
- 403 forbidden error for Image
More Posts:- Share Multiple Images in WhatsApp using Android Intent - WhatsApp
- 🎃 Trending, Popular Halloween hashtags for year 2020 🎃 [Facebook, Twitter, Instagram, Snapchat] - Hashtags
- Chrome : When Adobe flash player has finished updating, reload this page to active it - Chrome
- How to recover SharePoint FARM if the SQL Server IP changes - SharePoint
- SharePoint Excel error - The workbook cannot be opened because it contains the following features that are not supported by Excel in the browser - SharePoint
- error CAML Query containing special characters - SharePoint
- 4 Open Source SQLite Editor for Mac OS X , Windows and Linux - Mac-OS-X
- Android Emulator Screenshot saved location - Android-Studio