- react
- UI框架 - ant-design
- ajax工具 - reqwest
- 字体 - iconfont
- router - react-router
npm install && npm install [email protected] -g && npm install [email protected] -g
npm run dev
npm run prod
业务目前层级为两层,在src/page
下,第一层为业务模块,第二层为具体的业务逻辑。
创建了业务component之后,通过配置src/widget/route
关联hash
有了路由之后,在src/widget/frame
中配置左侧的nav导航
业务的模块放在src/widget
目录下,引用时使用widget
加模块名,例如引用search
,使用import Search from 'widget/search'
例子:
import Search from 'widget/search'
<Search
// 组件列表
widgets={[
// input框
{name:"name",type:"input",placeholder:"请输入名字",maxLength:20},
// select选择
{name:"sex",width:'120',type:'select',options:[
{value:-1,name:'请选择'},
{value:0,name:'男'},
{value:1,name:'女'}
]}
]}
// 点击查询执行的回调
onSearch={e=>{
console.log(e)
}}
/>