-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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: images 支持图集排列方式 #11490
feat: images 支持图集排列方式 #11490
Conversation
👍 Thanks for this! Please review the labels and make any necessary changes. |
if (!this.props.fontStyle) { | ||
return {}; | ||
} | ||
console.log(this.props.fontStyle); |
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
'"$2": "$4"' | ||
); | ||
styleObj = JSON.parse(validJsonStr); | ||
} else if (typeof this.props.fontStyle === 'object') { |
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.
typeof null 也是 object
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.props.fontStyle !== null
} | ||
console.log(this.props.fontStyle); | ||
let styleObj: object = {}; | ||
if (typeof this.props.fontStyle === 'string') { |
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.
fontStyle 为何不直接要求用户配置成对象,而是 json 字符串?
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
|
||
/** | ||
* 排列方式 | ||
* 类命名方式按照上下左右四个边命名,l=2m,m=2s,最小单位为s |
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
return (width - this.gap * 2) / 3; | ||
} else { | ||
return (width - this.gap) / 2; | ||
} |
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.
后续可以按照规则来优化一遍,而不是这样枚举
constructor(props: ImagesProps) { | ||
super(props); | ||
this.state = { | ||
enLargeUrl: '' |
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.
已去除
|
||
|
||
|
||
.enlarge-container{ |
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.
已经删除了,这部分功能删除了
What
修改Images组件,添加图集排序样式
Why
丰富排序样式
How
通过新增sortType字段分辨排序样式,不传入sortType字段,按照原来组件渲染。