this readme copy and edit for dva-cli this code copy and edit for umi
- 1.use ejs
- 2.change the app-structure like umi
- 3.crate app (or mobile app) for Git clone
- 4.the template managed to Git app mobile
- 1.update umi1.1
- 2.add Nested Route
Install, create and start.
# Install
$ npm install oni-cli -g
# Create app
$ oni new myapp
# Start app
$ cd myapp
$ npm i
$ npm start
We have 2 commands: new
and generate
(alias g
).
Create app with new directory.
$ oni new myapp
$ oni new myapp --mobile (or --web) ( create web app )
Generate page and component.
$ oni g page home
#generate component '/src/pages/home/components/Table.js'
$ oni g component Table home
#generate component '/src/components/Table.js'
$ oni g component Table
.
├── mock # mock data
├── user.js # the mock data test
├── public # index.html
├── src # Source directory
├── assets # Store images, icons, ...
├── components # UI components
├── layouts # layouts
├── models # Dva global models
├── pages # all pages (auto create Route)
├── plugins # umi plugins
├── services # Used for communicate with server
└── utils # Utils
├── request.js # A util wrapped dva/fetch
└── config.js # global config (name,api...)
├── global.less # global less
├── .editorconfig #
├── .eslintrc # Eslint config
├── .umirc.js # umi
├── .umirc.mock.js # umi mock
├── .webpackrc.js # webpackrc extend(lick alias prexy)
├── .gitignore #
└── package.json #
oni-cli use umi for build and server