定制 esign/laravel-react-components 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

esign/laravel-react-components

Composer 安装命令:

composer require esign/laravel-react-components

包简介

Use react components within laravel

README 文档

README

Latest Version on Packagist Total Downloads GitHub Actions

This packages allows you to register react components within your laravel application.

Installation

You can install the package via composer:

composer require esign/laravel-react-components

The package will automatically register a service provider.

Usage

To register the container for a react component a @reactComponent directive has been included. Props may be passed as the second parameter:

@reactComponent('article-card')
@reactComponent('article-card', ['article' => $article])

In case you want some more customization you may always use the anonymous component. This component allows you to pass additional attributes and define as what HTML tag the component should be rendered:

<x-react-component
    component="article-card"
    :props="['article' => $article]"
    as="span"
    class="container"
/>

To register the components in your frontend build, you may use the registerReactComponents function included in this package. This can be published using the following command:

php artisan react-components:install

The file will be copied to resources/assets/js/utils/registerReactComponents.js but may be moved to any other location.

import { ArticleCard } from "./Components/ArticleCard";
import { registerReactComponents } from "./utils/registerReactComponents";

registerReactComponents({
    'article-card': ArticleCard,
});

Testing

composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 13.94k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固