简体   繁体   English

Laravel Vue Inertia 需要硬刷新 app.blade 中的脚本资产,每次更改路线

[英]Laravel Vue Inertia need hard refresh for script asset in app.blade every change route

I have a script tag from CoreUI in my app.blade.php <script src="{{ asset('js/coreui.js') }}" defer></script> the problem is in every route page the script isn't being called thus not working the functions inside, I tried to require it in my app.js require('./coreui') but still doesn't work.我的 app.blade.php 中有一个来自 CoreUI 的脚本标签<script src="{{ asset('js/coreui.js') }}" defer></script>问题出在脚本所在的每个路由页面中' 没有被调用,因此内部的函数不起作用,我试图在我的 app.js require('./coreui')要求它,但仍然不起作用。 To make it work I need to hard refresh the browser.为了使它工作,我需要硬刷新浏览器。

你提供了一些小信息,但试试这个:

<script src="{{ mix('/js/coreui.js') }}" defer></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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