【发布时间】:2021-07-12 21:40:16
【问题描述】:
Jetstream 默认使用 Vue JS 版本 3 安装惯性,即使我们在安装 Inertia 时可以选择惯性版本。
我计划使用的几个 Vue 插件仍然不支持 Vue3。那么是否可以使用 Vue JS 2 安装 Jetstream?
【问题讨论】:
标签: laravel vue.js vuejs2 inertiajs jetstream
Jetstream 默认使用 Vue JS 版本 3 安装惯性,即使我们在安装 Inertia 时可以选择惯性版本。
我计划使用的几个 Vue 插件仍然不支持 Vue3。那么是否可以使用 Vue JS 2 安装 Jetstream?
【问题讨论】:
标签: laravel vue.js vuejs2 inertiajs jetstream
是的,您可以使用旧的 jetstream 版本。 jetstream 版本 2.2.0 支持 vue3,在此之前它将支持 vue2。但它可能包含一些错误。 使用 vue2 安装 jetstream 在终端上运行注释
laravel new hello
cd hello
编辑 composer.json "laravel/jetstream": "^2.1",
然后在终端上运行composer install; php artisan jetstream:install inertia。
最后在终端上运行npm install; npm run dev; php artisan migrate。
【讨论】:
@bapi 是对的,你需要使用旧版本的Laravel Jetstream。
您需要使用确切的喷射流 "laravel/jetstream": "2.1.4" 而不是安装 inertiajs 和 vuejs2 的 "laravel/jetstream": "^2.1"。
在此处查看来自官方 repo https://github.com/laravel/jetstream/blob/2.x/CHANGELOG.md 的变更日志
【讨论】:
@bapi 不对@kikuyu1 有更好的答案,请按照以下确切步骤解决 fresh 项目中的问题
composer.json 文件中将laravel/jetstream": "2.1.4" 添加到"require" 依赖项中composer update
php artisan jetstream:install inertia
npm install
npm run dev
php artisan migrate
现在你的 Laravel 8 项目应该安装了带有 vue 2 的 Laravel Jetstream
【讨论】: