简体   繁体   English

如何在没有jetstream和惯性的laravel 8中安装vue js?

[英]How to install vue js in laravel 8 without jetstream and Inertia?

I'm working on a project with Laravel 8 version and I want to work with vue js components without installing jetstream and inertia.我正在开发一个 Laravel 8 版本的项目,我想在不安装 jetstream 和惯性的情况下使用 vue js 组件。 Is it needed to install Jetstream with inertai in order to work with vue js in laravel 8?是否需要使用 inertai 安装 Jetstream 才能在 laravel 8 中使用 vue js?

At first, you need to install laravel/ui package by running composer require laravel/ui:^2.4 as Said in laravel doc version 7首先,您需要通过运行composer require laravel/ui:^2.4来安装 laravel/ui package,如laravel doc version 7中所述

After that, you should run php artisan ui vue for adding vue scaffolding to the project.之后,您应该运行php artisan ui vue以将 vue 脚手架添加到项目中。

You don't need any additional Laravel components to use Vue.您不需要任何额外的 Laravel 组件即可使用 Vue。 You only need npm or yarn to install packages and create a composer.json file.您只需要 npm 或 yarn 即可安装包并创建 composer.json 文件。 Follow the instructions at https://v2.vuejs.org/v2/guide/ (for Vue2) or https://v3.vuejs.org/guide/introduction.html for (Vue3) for installation.按照https://v2.vuejs.org/v2/guide/ (适用于 Vue2)或https://v3.vuejs.org/guide/introduction.ZFC35FDC70D32FC69D263EZ8883上的说明进行操作。

For Laravel/Vue, Vue will be used as a front-end, which will use ajax/Axios to use GET/POST requests to Laravel for the backend.对于 Laravel/Vue,Vue 将用作前端,后端将使用 ajax/Axios 对 Laravel 使用 GET/POST 请求。

after create laravel project,you need to install laravel/ui and don't specify the version创建 laravel 项目后,需要安装 laravel/ui 并且不要指定版本

composer require laravel/ui

then run php artisan ui vue --auth for Generate login / registration scaffolding...然后运行php artisan ui vue --auth生成登录/注册脚手架...

php artisan ui vue without login/registration php artisan ui vue无需登录/注册

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

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