在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):talyssonoc/react-laravel开源软件地址(OpenSource Url):https://github.com/talyssonoc/react-laravel开源编程语言(OpenSource Language):PHP 86.3%开源软件介绍(OpenSource Introduction):react-laravelWith InstallationV8js dependencyIt's important to know that You can see how to install it here: how to install v8js. ComposerSet the "minimum-stability": "dev" Then run: $ composer require talyssonoc/react-laravel:0.11 After that you should add this to your providers at the 'React\ReactServiceProvider' And then run: php artisan vendor:publish And the UsageAfter the installation and configuration, you'll be able to use the The @react_component(<componentName>[, props, options])
//example
@react_component('Message', [ 'title' => 'Hello, World' ], [ 'prerender' => true ])
// example using namespaced component
@react_component('Acme.Message', [ 'title' => 'Hello, World' ], [ 'prerender' => true ])
All your components should be inside You must include
$ php artisan vendor:publish --force For using the files provided by <script src="{{ asset('vendor/react-laravel/react.js') }}"></script>
<script src="{{ asset('vendor/react-laravel/react-dom.js') }}"></script>
<script src="{{ asset('js/components.js') }}"></script>
<script src="{{ asset('vendor/react-laravel/react_ujs.js') }}"></script> If you'll use a different version from the one provided by react-laravel (see ConfigurationsYou can change settings to return [
'source' => 'path_for_react.js',
'dom-source' => 'path_for_react-dom.js',
'dom-server-source' => 'path_for_react-dom-server.js',
'components' => [ 'path_for_file_containing_your_components.js' ]
]; All of them are optional.
Your ThanksThis package is inspired at react-rails. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论