我发现如果我有一个模板的特定javascript,我需要用我的整体脚本实际渲染它。 js文件,而不仅仅是该特定模板的片段。 有没有办法在laravel中默认执行此操作? p>
所以将模板中的所有javascript附加到编译的scripts.js文件中? 它只会使输出更有吸引力,并确保我有必要的依赖项和对象? p> div>
I am finding that if I have specific javascript for a template, I need to actually render it with my overall scripts.js file, not just as a snippet on that particular template. Is there any way to do this in laravel by default?
So append all javascript in the template to the scripts.js file that is compiled? It would just make the output a lot more attractive and would ensure that I have the necessary dependencies and objects?
我发现如果我有一个模板的特定javascript,我需要用我的整体脚本实际渲染它。 js文件,而不仅仅是该特定模板的片段。 有没有办法在laravel中默认执行此操作? p>
所以将模板中的所有javascript附加到编译的scripts.js文件中? 它只会使输出更有吸引力,并确保我有必要的依赖项和对象? p> div>