[英]Laravel Inertia scaffolding but with vue2
The laravel starter kit install inertia with authorizations components in vue3. laravel 入门套件在 vue3 中使用授权组件安装惯性。 I must use vue2 because other reasons.
由于其他原因,我必须使用 vue2。 Is there anyone who has been able to configure it using vue2
有没有人能够使用 vue2 配置它
you need to install an older version for Jetstream, edit composer.json and change您需要为 Jetstream 安装旧版本,编辑 composer.json 并更改
"laravel/jetstream": "2.1.4"
And finally最后
npm install; npm run dev; php artisan migrate
If you check the installation guide here incase of vue2
如果您在此处查看安装指南
vue2
Make sure that you remove inertia-vu3
like this确保像这样删除
inertia-vu3
npm rm @inertiajs/inertia-vue3
Install the Inertia client-side adapters using NPM or Yarn.使用 NPM 或 Yarn 安装 Inertia 客户端适配器。
npm install @inertiajs/inertia @inertiajs/inertia-vue
yarn add @inertiajs/inertia @inertiajs/inertia-vue
Next, update your main JavaScript file to boot your Inertia app.接下来,更新您的主 JavaScript 文件以启动您的 Inertia 应用程序。 All we're doing here is initializing the client-side framework with the base Inertia component.
我们在这里所做的只是使用基本 Inertia 组件初始化客户端框架。
import Vue from 'vue'
import { createInertiaApp } from '@inertiajs/inertia-vue'
createInertiaApp({
resolve: name => require(`./Pages/${name}`),
setup({ el, App, props, plugin }) {
Vue.use(plugin)
new Vue({
render: h => h(App, props),
}).$mount(el)
},
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.