Laravel Jetstream使用Vite

发布于 2025-02-12 18:09:43 字数 431 浏览 1 评论 0原文

抱歉,

当我将Laravel Jetstream用于我的项目时,我的英语很糟糕。因为当我使用stack livewire时,显示不匹配,在这里我给出输出结果 在此处输入图像描述

,而且我还运行了NPM install& NPM运行开发人员,因此它将使用Mix默认运行开发 在这里,我将提供项目文件夹结构 在此处输入图像描述

也许我可以得出的结论是将开发过程从Mix转换为Vite,或者这里有专家有关如何解决问题的提示? 先感谢您

sorry in advance my english is bad

I have a problem when I will use laravel jetstream for my project. Because when i used stack livewire, the display doesn't match, here I give the output result
enter image description here

And also I've run npm install & npm run dev so it will run development using mix as default
Here I will give the project folder structure
enter image description here

maybe what I can conclude is to change the development process from mix to vite, or there are hints from the experts here on how to solve the problem?.
Thank you in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

诠释孤独 2025-02-19 18:09:43

实际上,您可以通过在视图/布局/应用程序和来宾刀片中替换@vite来解决此问题。

<!-- Styles -->
<link rel="stylesheet" href="{{ mix('css/app.css') }}">

<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>

Actually you can fix this issue by replacing the @vite with these one in views/layouts/app and guest blade.

<!-- Styles -->
<link rel="stylesheet" href="{{ mix('css/app.css') }}">

<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>
走过海棠暮 2025-02-19 18:09:43

因为您安装了laravel的先前版本,所以@vite添加了9。+ laravel,所以我认为它只是BC您使用8。(Any&lt; 9)版本,只需安装以前的jetstream版本,例如<强>作曲家需要Laravel/Jetstream:2.7.0

because you install previous version of laravel, @vite was added in 9.+ laravel so i think its just bc you using 8. (any <9) version, just install previous jetstream version for example composer require laravel/jetstream:2.7.0

东京女 2025-02-19 18:09:43

转到 Resources \ view \ Layouts \ Guest.blade.php Resources \ view \ layouts \ layouts \ app.blade.php 并替换下面的代码(如果不存在),只是在这两个文件中插入以下代码。
,还记得发表评论@Vite线,请参见下面的屏幕截图。
请参阅ScreenShot
我希望它能解决问题。

<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>

go to resources\views\layouts\guest.blade.php and resources\views\layouts\app.blade.php and replace below code, if its not there, just insert below code in these two files.
and also remember to comment out @vite line, see below screenshot.
see screenshot
I hope it will solve the problem.

<link rel="stylesheet" href="{{ asset('css/app.css') }}">
<script src="{{ asset('js/app.js') }}" defer></script>
倾城°AllureLove 2025-02-19 18:09:43

这可以帮助您解决@vite:
PHP工匠视图:清除

this can help you to solve @vite :
php artisan view:clear

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文