如何将CoreUI整合到React Rails应用程序中?

时间:2019-09-01 16:39:09

标签: ruby-on-rails reactjs core-ui

我想将CoreUI添加到我的React Rails应用程序中。
我知道有npm软件包:@ coreui / react
但是我不知道如何将其导入到我的react项目中...

谢谢!

1 个答案:

答案 0 :(得分:-1)

好的,所以我在Rails应用程序中安装了coreui react模板。

1 /在此处下载coreui react模板(https://github.com/coreui/coreui-free-react-admin-template
2 / rails new coreui-react-rails-app --webpack = react
3 /在您的应用中安装coreui模板的package.json的所有依赖项

"@coreui/coreui": "^2.1.12",
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
"@coreui/icons": "0.3.0",
"@coreui/react": "^2.5.1",
"bootstrap": "^4.3.1",
"chart.js": "^2.8.0",
"classnames": "^2.2.6",
"core-js": "^3.1.4",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"flag-icon-css": "^3.3.0",
"font-awesome": "^4.7.0",
"node-sass": "^4.12.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-app-polyfill": "^1.0.1",
"react-chartjs-2": "^2.7.6",
"react-dom": "^16.8.6",
"react-router-config": "^5.0.1",
"react-router-dom": "^5.0.1",
"react-test-renderer": "^16.8.6",
"reactstrap": "^8.0.0",
"simple-line-icons": "^2.4.1"  

4 /将所有src /内容移至rails应用的app / javascript /文件夹中
5 /将index.js移至packs webpack文件夹(在app / javascript / packs中)
6 /在应用程序/资产/样式表中移动scss文件夹和App.scss的内容(通过webpack加载) 7 /使用packs / index.js文件链接轨道
8 /就这样!

请告诉我您是否有问题!