2019-06-17 19:52:16 +08:00
|
|
|
# naive-ui
|
|
|
|
TuSimple Vue-Based Frontend Component Library
|
2019-07-10 11:42:46 +08:00
|
|
|
## Documentation
|
2019-07-10 14:08:16 +08:00
|
|
|
[http://***REMOVED***/#/start](http://***REMOVED***/#/start)
|
|
|
|
## Repository
|
|
|
|
[https://***REMOVED***/naive-ui/tree/develop](https://***REMOVED***/naive-ui/tree/develop)
|
2019-07-10 11:42:46 +08:00
|
|
|
## Develop Guidelines
|
|
|
|
### Git Commit Message Style
|
2019-07-10 14:16:25 +08:00
|
|
|
You **MUST** follow [Angular Commit Format](https://gist.github.com/brianclements/841ea7bffdb01346392c).
|
2019-07-10 11:42:46 +08:00
|
|
|
|
|
|
|
If you want see some example, see [Angular Commits on Github](https://github.com/angular/angular/commits/master).
|
|
|
|
### Code Styles
|
|
|
|
#### Javascript Style
|
2019-07-10 14:16:25 +08:00
|
|
|
You **MUST** follow [Standard JS](https://standardjs.com/).
|
2019-07-10 11:42:46 +08:00
|
|
|
#### SCSS Style
|
2019-07-10 14:18:00 +08:00
|
|
|
Run `npm run lint-style` to check styles.
|
2019-07-10 11:42:46 +08:00
|
|
|
#### Check Both
|
|
|
|
Run `npm run lint`
|
|
|
|
You **MUST** fix all lint warnings and errors before you push your branch.
|
|
|
|
### Unit test
|
|
|
|
If you create a component, you **MUST** add unit test for it.
|
|
|
|
|
|
|
|
Run `npm run test` to test all components.
|
|
|
|
Run `npm run test-cov` to test all components and see detailed test coverage report.
|
|
|
|
|
|
|
|
## Want to see how component works
|
2019-07-10 11:18:19 +08:00
|
|
|
1. Run `npm run build`
|
|
|
|
2. Open `http://localhost:8086/` in browser.
|
2019-07-10 11:42:46 +08:00
|
|
|
## Want to add your own component
|
2019-07-10 14:49:20 +08:00
|
|
|
There is no guideline for now. If you want to know how to do it, you can explore by yourself or ask `lecong.zhang@tusimple.ai`.
|
2019-07-10 11:42:46 +08:00
|
|
|
## Publish a new version
|
|
|
|
1. You **MUST** change your version according to [semver](https://semver.org/)
|
2019-07-10 11:18:19 +08:00
|
|
|
2. `npm run release`
|
2019-07-10 11:42:46 +08:00
|
|
|
3. You **MAY** publish documentation by running `npm run release-doc`
|
|
|
|
## Installation & Usage
|
|
|
|
First install it.
|
|
|
|
```
|
|
|
|
npm install --save-dev naive-ui
|
|
|
|
```
|
|
|
|
Then add the following lines in you entry point js file.
|
2019-06-17 20:10:35 +08:00
|
|
|
```
|
|
|
|
...
|
2019-07-10 11:00:50 +08:00
|
|
|
import naiveUi from 'naive-ui'
|
|
|
|
import 'naive-ui/dist/lib/index.css
|
|
|
|
|
|
|
|
Vue.use(naiveUi)
|
2019-06-17 20:10:35 +08:00
|
|
|
...
|
|
|
|
```
|
2019-07-10 11:42:46 +08:00
|
|
|
## Component Develop Status
|
2019-07-10 14:08:16 +08:00
|
|
|
|
2019-07-10 15:04:08 +08:00
|
|
|
|Component|Develop status|Unit Test|Note|
|
|
|
|
|--|:--:|:--:|--|
|
|
|
|
|Alert|😍|❌||
|
|
|
|
|Button|😍|🆗||
|
|
|
|
|Checkbox|😍|🆗||
|
|
|
|
|DatePicker|😍|❌||
|
|
|
|
|GradientText|😍|🆗||
|
|
|
|
|Icon|😍|🆗||
|
|
|
|
|Input|😍|🆗||
|
|
|
|
|Message|😍|❌|Code clean in need|
|
|
|
|
|Modal|😍|❌|Code clean in need|
|
|
|
|
|Notification|😍|❌|Code clean in need|
|
|
|
|
|Pagination|😍|🆗|Unit test is not enough|
|
|
|
|
|Popup|😍|❌||
|
|
|
|
|Select|😍|🆗|Multiple search is not done|
|
|
|
|
|Switch|😍|❌||
|
|
|
|
|FormItem|🚧|❌||
|
|
|
|
|Form|🚧|❌||
|
|
|
|
|Table|🚧|❌|Function is not fulfilled|
|
|
|
|
|Tooltip|😍|❌|Remove the dependency of Popper.js|
|
|
|
|
|Popup|😍|❌|May be need to merge with Tooltip|
|
2019-07-10 11:42:46 +08:00
|
|
|
## Todo
|
2019-07-10 11:18:19 +08:00
|
|
|
1. Z-index management on `Select` & `Tooltip` & `Modal`(Low Priority)
|
|
|
|
2. Full featured table component(Medium Priority)
|
|
|
|
3. Form component(Medium Priority)
|
2019-07-10 14:40:25 +08:00
|
|
|
4. FormItem component(High Priority)
|
|
|
|
5. Complete unit test for all existing components(High Priority)
|
|
|
|
6. Create a Markdown webpack loader to convert documentation(Low Priority)
|
|
|
|
7. Refactor documentation page(for code clairity)
|
|
|
|
8. Code refactor for some 😢 messy code(which is my bad...)
|