mimicreative/yii2-react 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mimicreative/yii2-react

Composer 安装命令:

composer require mimicreative/yii2-react

包简介

ReactJS Asset Bundle for Yii2

关键字:

README 文档

README

Installation

The preferred way to install this extension is through composer.

Add to the require section of your composer.json file:

"mimicreative/yii2-react": "~1.0"

And run in terminal

composer update

Usage

Use as the asset bundle in Yii2 View files.

// use this if you do not need addons
\mimicreative\react\ReactAsset::register($this);

// use this if you need addons
\mimicreative\react\ReactWithAddonsAsset::register($this);

By default, this extension use the minified version. I also include the react-dom.min.js because we usually need it to render in js files. To customize what asset to use, you can set the configuration in the Yii2 config files. Please refer to React Bower package for the list of the files.

For example if you want to use non-minified version:

// in main.php config file

return [
  'components' => [
    'assetManager' => [
      'bundles' => [
        'mimicreative\react\ReactAsset' => [
          'js' => [
            'react.js',
            'react-dom.js'
          ]
        ],
        'mimicreative\react\ReactWithAddonsAsset' => [
          'js' => [
            'react-with-addons.js',
            'react-dom.js'
          ]
        ]
      ]
    ]
  ]
];

Further Information

Please, check the React.js site documentation for further information about its configuration options.

统计信息

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

GitHub 信息

  • Stars: 13
  • Watchers: 4
  • Forks: 11
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固