问题
I just started learning how to work with a Laravel
server and I want to use Vue
. But after installing the app.js
file only has require('/bootstrap');
in it, shouldn't it have the required components and the const app field?
I used npm install
and npm run watch
. What am I doing wrong?
回答1:
Laravel 6 doesn't ship with frontend scaffolding anymore, they shipped that to a new package called Laravel UI so install it and scaffold VueJS
composer require laravel/ui
php artisan ui vue
And if you need the authentication views like login
and register
php artisan ui vue --auth
Docs
来源:https://stackoverflow.com/questions/57888300/laravel-6-0-app-js-only-has-require-bootstrap