简体   繁体   中英

How to remove app.js in Laravel but keep vue.js?

I want to remove "public/app.js" from my Laravel project, but when I do that my vue.js instance doesn't work. Is there any way to remove app.js but keep calling vue.js ?

If you're only wanting to include vue in your application you can either remove the code you don't want from app.js or pull in a standalone version of vue .

To just have vue in your app.js remove the require('./bootstrap'); line from your resources/js/app.js file and then run npm run dev (or npm run production ).


Otherwise, you can remove app.js entirely and use one of the methods outlined on Vue's installation page eg:

<script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script> 

You may need to change the version number.


The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM