1.创建react:
npm install -g create-react-app
npm create-react-app demo
cd demo
npm start
2.安装antd:
2.1 npm install antd-mobile --save
2.2 按需引入插件,不用单独组件写css:
npm install babel-plugin-import --save
2.3 查看所有的配置信息:
npm run eject
2.4 配置antd放入package.json下的babel中:
“plugins”: [
[“import”, { “libraryName”: “antd-mobile”, “style”: “css” }]
]
3.php服务器:
3.1 可用不同的终端访问数据
composer create-project symfony/framework-standard-edition my_project_name
cd my_project_name/
php bin/console server:run
3.2 创建新Bundle
php bin/console generate:bundle --namespace=Acme/TestBundle
3.3 添加composer.json里autoload的Bundle
3.4 创建数据库
php bin/console doctrine:database:create
生成getters和setters
php bin/console doctrine:generate:entities AppBundle/Entity/Product
创建表
php bin/console doctrine:schema:update --force
sql语句写*会报500的错误!
4.jquery
npm install jquery
导入jquery.min.js
5.路由
5.1将路由写在Resources的config下
如:app:
resource: ‘…/Resources/config/routing.yml’
prefix: /
5.2在routing.yml下添加路由
如:index:
path: /
defaults: {_controller:AppBundle:Default:index}
react+antd+php
最新推荐文章于 2024-08-19 18:08:02 发布