Skip to content

Commit

Permalink
feat: Slider组件支持
Browse files Browse the repository at this point in the history
  • Loading branch information
lili.21 committed Aug 1, 2023
1 parent bafb698 commit 476c1d6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Replacing `<path>` and `<transform>` with appropriate values.
- [ ] Tooltip
- [ ] Divider
- [x] Tabs
- [ ] Drawer
- [ ] Spin
- [ ] Empty
- [x] Drawer
- [x] Spin
- [x] Empty
- [ ] Modal
- [ ] Slider
- [x] Slider
- [ ] Popover
- [ ] Col
- [ ] Row
Expand Down
4 changes: 4 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ const TRANSFORMER_INQUIRER_CHOICES = [
{
name: 'Empty',
value: 'Empty'
},
{
name: 'Slider',
value: 'Slider'
}
].sort((a, b) => a.name.localeCompare(b.name))

Expand Down
9 changes: 9 additions & 0 deletions transforms/Slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const { removeAntdImportAndAddSemiImport } = require('./utils')
module.exports = function transformer(file, api) {
const j = api.jscodeshift
const root = j(file.source)

removeAntdImportAndAddSemiImport(j, root, 'Slider', 'Slider')

return root.toSource()
}

0 comments on commit 476c1d6

Please sign in to comment.