jobyh/laravel-react-make

此包已被弃用,不再维护。未建议替代包。

用于生成 React 组件的 Artisan 命令

v1.1.0 2020-12-19 15:03 UTC

This package is auto-updated.

Last update: 2021-11-26 08:58:35 UTC


README

Build Status

此仓库已被存档。请使用 👉 此包 代替。😄

用于生成 React 函数组件和类组件的 Artisan 生成器。支持 Laravel 8、7 和 6。

快速开始

% cd /path/to/laravel/project
% composer require --dev jobyh/laravel-react-make

自定义占位符

在 Laravel 中发布占位符是一个 非常好的功能。是的,请。

% php artisan vendor:publish --tag react-stub

使用方法

生成 React 函数组件

% php artisan make:react MyComponent
# -> resources/js/components/MyComponent.js

在子目录下生成

% php artisan make:react foo/bar/MyComponent
# -> resources/js/components/foo/bar/MyComponent.js

使用 .jsx 文件扩展名(也可使用简写 -x

% php artisan make:react --jsx MyComponent
# -> resources/js/components/MyComponent.jsx

生成基于类的组件(也可使用简写 -c

% php artisan make:react --class MyComponent
# -> resources/js/components/MyComponent.js