-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(carousel): add arrow prop #451
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/tusimple/naive-ui/99XFPKRscMJne582RkheFhaA4UgF |
Codecov Report
@@ Coverage Diff @@
## main #451 +/- ##
==========================================
+ Coverage 36.72% 36.79% +0.07%
==========================================
Files 507 507
Lines 12164 12169 +5
Branches 3342 3345 +3
==========================================
+ Hits 4467 4478 +11
+ Misses 6835 6828 -7
- Partials 862 863 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
来个测试,把新增的覆盖一下
CHANGELOG.en-US.md
Outdated
@@ -12,6 +12,7 @@ | |||
### Feats | |||
|
|||
- `n-tree` exports `TreeDragInfo` & `TreeDropInfo` type. | |||
- `n-carousel` add `arrow` prop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `n-carousel` add `arrow` prop. | |
- `n-carousel` add `show-arrow` prop. |
CHANGELOG.zh-CN.md
Outdated
@@ -12,6 +12,7 @@ | |||
### Feats | |||
|
|||
- `n-tree` 导出 `TreeDragInfo` & `TreeDropInfo` 类型 | |||
- `n-carousel` 新增 `arrow` 属性 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- `n-carousel` 新增 `arrow` 属性 | |
- `n-carousel` 新增 `show-arrow` 属性 |
@@ -17,6 +18,7 @@ dot-placement | |||
|
|||
| Name | Type | Default | Description | | |||
| --- | --- | --- | --- | | |||
| arrow | `boolean` | `false` | Arrow button. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| arrow | `boolean` | `false` | Arrow button. | | |
| show-arrow | `boolean` | `false` | Whether to show arrow button. | |
@@ -17,6 +18,7 @@ dot-placement | |||
|
|||
| 名称 | 类型 | 默认值 | 说明 | | |||
| --- | --- | --- | --- | | |||
| arrow | `boolean` | `false` | 显示箭头按钮 | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| arrow | `boolean` | `false` | 显示箭头按钮 | | |
| show-arrow | `boolean` | `false` | 是否显示箭头按钮 | |
src/carousel/src/Carousel.tsx
Outdated
@@ -350,6 +353,62 @@ export default defineComponent({ | |||
) | |||
})} | |||
</div> | |||
{arrow && !vertical && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arrow && [
btn1 class = vertical ? right : top,
btn2 class = vertical ? right : top,
]
大概就这个意思,减少重复代码
height: 30%; | ||
width: 8%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我们还是先弄成固定大小吧
|
||
for (const item of dotToArrow) { | ||
for (const dotItem of item.dot) { | ||
await wrapper.setProps({ showArrow: true, dotPlacement: dotItem }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试没到位, 需测点击前后按钮后是否正确切换
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
.trigger('click') | ||
.then(async () => { | ||
expect(slidesDOMArray[2].attributes('aria-hidden')).toBe('false') | ||
await sleep(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
话说这个应该有办法绕过去
close #410