javascript - Laravel 5.3 中新的 app.js 的目的是什么?

标签 javascript laravel

在我创建了一个新的 Laravel 项目后,我注意到现在在 5.3 中,在项目目录/js 中生成了一个新的 app.js。

这是 app.js

这个预生成的 javascript 文件的用途是什么?

最佳答案

根据 Laravel 文档:

By default, the Laravel gulpfile.js file compiles your SASS and the resources/assets/js/app.js file. Within the app.js file you may register your Vue components or, if you prefer a different framework, configure your own JavaScript application. Your compiled JavaScript will typically be placed in the public/js directory.

The app.js file will load the resources/assets/js/bootstrap.js file which bootstraps and configures Vue, Vue Resource, jQuery, and all other JavaScript dependencies. If you have additional JavaScript dependencies to configure, you may do so in this file.

它也用于编写 Vue 组件。

关于javascript - Laravel 5.3 中新的 app.js 的目的是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40068395/

相关文章:

javascript - 如何创建集中在 JS 特定区域的随机点?

javascript - 使用 jQuery 将实例从 View 传递到 Controller

php - 传递给 array_sort() 的参数 2 必须是可调用的,给定字符串

php vs javascript 处理信息的速度

javascript - 将两个 JavaScript 数组相加

javascript - JavaScript 中的 & 和 && 有什么区别?

laravel - Laravel x Docker:如何从排队的作业中获取STDOUT日志?

php - Laravel 5.1 - 一般错误 : 1005 Can't create table (mysql)

php - 403 Forbidden on nginx/1.4.6 (Ubuntu) - Laravel

laravel - Laravel 邮件模板 $slot 变量定义在哪里