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

feat: images 支持图集排列方式 #11490

Merged
merged 53 commits into from
Feb 13, 2025
Merged

feat: images 支持图集排列方式 #11490

merged 53 commits into from
Feb 13, 2025

Conversation

bawawa
Copy link
Contributor

@bawawa bawawa commented Jan 11, 2025

What

修改Images组件,添加图集排序样式

Why

丰富排序样式

How

通过新增sortType字段分辨排序样式,不传入sortType字段,按照原来组件渲染。

@github-actions github-actions bot added the feat label Jan 11, 2025
Copy link

👍 Thanks for this!
🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

@2betop 2betop changed the title Feat images feat: images 支持图集排列方式 Jan 15, 2025
if (!this.props.fontStyle) {
return {};
}
console.log(this.props.fontStyle);
Copy link
Member

Choose a reason for hiding this comment

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

??

Copy link
Contributor Author

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') {
Copy link
Member

Choose a reason for hiding this comment

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

typeof null 也是 object

Copy link
Contributor Author

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') {
Copy link
Member

Choose a reason for hiding this comment

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

fontStyle 为何不直接要求用户配置成对象,而是 json 字符串?

Copy link
Contributor Author

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
Copy link
Member

@2betop 2betop Feb 13, 2025

Choose a reason for hiding this comment

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

注释描述有错误,顺序错了

Copy link
Contributor Author

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;
}
Copy link
Member

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: ''
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个用到了吗

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已去除




.enlarge-container{
Copy link
Member

Choose a reason for hiding this comment

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

这个不是全局类吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已经删除了,这部分功能删除了

@hsm-lv hsm-lv merged commit 09624ed into baidu:master Feb 13, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants