Skip to content
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

datePicker 添加默认渲染slot支持 #957

Merged
merged 2 commits into from
Jul 16, 2019

Conversation

cxdmaye
Copy link
Contributor

@cxdmaye cxdmaye commented Jul 11, 2019

First of all, thank you for your contribution! 😄

New feature please send pull request to feature branch, and rest to master branch.
Pull request will be merged after one of collaborators approve.
Please makes sure that these form are filled before submitting your pull request, thank you!

[中文版模板 / Chinese template]

This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Branch merge
  • Other (about what?)

What's the background?

  1. DatePicke组件的触发区域有时候不仅仅限于输入框

API Realization (Optional if not new feature)

  1. 在DatePicker和RangePicker的默认Slot中展示自定义内容,替换原Input部分

What's the effect? (Optional if not new feature)

  1. 可能会导致原未指定name的slot渲染出错

Changelog description (Optional if not new feature)

Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Additional Plan? (Optional if not new feature)

@netlify
Copy link

netlify bot commented Jul 11, 2019

Deploy preview for ant-desing-vue processing.

Building with commit 2d909c0

https://app.netlify.com/sites/ant-desing-vue/deploys/5d2db0d03508d90008e9d709

@codecov
Copy link

codecov bot commented Jul 11, 2019

Codecov Report

Merging #957 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #957      +/-   ##
==========================================
- Coverage   87.25%   87.23%   -0.03%     
==========================================
  Files         145      145              
  Lines        4832     4832              
  Branches     1423     1423              
==========================================
- Hits         4216     4215       -1     
  Misses        572      572              
- Partials       44       45       +1
Impacted Files Coverage Δ
components/date-picker/RangePicker.jsx 87.69% <ø> (ø) ⬆️
components/date-picker/createPicker.js 76.11% <ø> (ø) ⬆️
components/upload/UploadList.jsx 89.41% <0%> (-1.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 75dd9f6...2d909c0. Read the comment docs.


<cn>
#### 自定义渲染
增加选择时间功能,当 `showTime` 为一个对象时,其属性会传递给内建的 `TimePicker`。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

介绍没更改 中英都是

@@ -409,6 +409,7 @@ export default {
openChange: this.handleOpenChange,
},
style: popupStyle,
scopedSlots: $scopedSlots.default ? $scopedSlots : null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以直接这样 scopedSlots: { default: input, ...this.$scopedSlots },

@@ -422,7 +423,7 @@ export default {
onMouseenter={this.onMouseEnter}
onMouseleave={this.onMouseLeave}
>
<VcDatePicker {...vcDatePickerProps}>{input}</VcDatePicker>
<VcDatePicker {...vcDatePickerProps}>{$scopedSlots.default ? '' : input}</VcDatePicker>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

全部挂载到scopedSlots 后,可以直接 <VcDatePicker {...vcDatePickerProps} />

@tangjinzhou tangjinzhou merged commit 68c212d into vueComponent:master Jul 16, 2019
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants