-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: update step #2379
feat: update step #2379
Conversation
components/_util/props-util.js
Outdated
export function isEmptyElement(c) { | ||
return typeof c.type === 'symbol' && c.children.trim() === ''; | ||
return typeof c.type === Comment; |
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.
? rebase 看看
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.
ok
components/steps/index.jsx
Outdated
@@ -41,30 +39,27 @@ const Steps = { | |||
const getPrefixCls = this.configProvider.getPrefixCls; | |||
const prefixCls = getPrefixCls('steps', customizePrefixCls); | |||
const iconPrefix = getPrefixCls('', customizeIconPrefixCls); | |||
const progressDot = this.progressDot || this.$slots.progressDot; |
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.
getComponent(this, 'progressDot')
components/vc-steps/Step.jsx
Outdated
|
||
function isString(str) { | ||
return typeof str === 'string'; | ||
} | ||
function noop() {} | ||
export default { | ||
name: 'Step', | ||
inheritAttrs: 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.
如果声明了 inheritAttrs: false, class style 都需要单独处理
如果不声明就要单独声明事件
components/vc-steps/Steps.jsx
Outdated
progressDot, | ||
icons, | ||
...childProps, | ||
...this.$attrs, |
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.
这里只需要传 this.$attrs.slots 就可以了吧 多测试下 单测可以改一下了
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.
我先看看test-utils都改啥了,目前steps里面除了demo和mountTest好像没啥单测了
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.
这里我想了一下不用传this.$attrs了,里面没有需要从父组件传子组件的,progressDot已经从props传了
onItemClick(...args) { | ||
const { onClick } = this.$props; | ||
|
||
if (onClick) { |
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.
可以不用判断
}; | ||
return ( | ||
<div {...stepsProps}> | ||
{filteredChildren.map((child, index) => { | ||
const childProps = getPropsData(child); | ||
const childProps = child.props || {}; |
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.
还是用 getPropsData 不然有驼峰和下划线问题
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. |
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 ...
What's the background?
API Realization (Optional if not new feature)
What's the effect? (Optional if not new feature)
Changelog description (Optional if not new feature)
Self Check before Merge
Additional Plan? (Optional if not new feature)