如何将Office UI Fabric ChoiceGroup分为2行和5列?

发布于 2025-01-28 00:44:51 字数 526 浏览 3 评论 0原文

我是UI的新手,目前正在努力使用Fluent UI ChoiceGroup创建选项。我有10个条目,假设0,1,2,3,4,5,6,7,8,9。我试图强迫UI总是显示出

0 1 2 3 4

5 6 7 8 9,

但它会根据宽度而变化。

我也没有可以在ChoiceGroup中附加的属性。看起来像一些CSS的东西。

请指导我。谢谢。

I am new to UI, and currently working on making on creating options using Fluent UI ChoiceGroup. I have 10 entries, let's say 0,1,2,3,4,5,6,7,8,9. I am trying to force UI to always show like

0 1 2 3 4

5 6 7 8 9

but it changes according to width.
enter image description here

There is no property that I can attach in the choiceGroup as well. It looks like some CSS stuff.

Please guide me with this. Thank you.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必了 2025-02-04 00:44:51

我看不到更好的方法来实现该方案,然后将固定的width choces> choceygroup root元素:

<ChoiceGroup styles={{ root: { width: 500 } }} label="Pick one icon" defaultSelectedKey="day" options={options} />

choce> choceygroup内部的项目用flexcontainer 包括:

display: flex;
flex-wrap: wrap;

如果需要:

<ChoiceGroup styles={{ flexContainer: { flexWrap: 'nowrap' } }} defaultSelectedKey="day" options={options} />

工作示例。

I don't see better way to achieve that scenario then to put fixed width of ChoiceGroup root element:

<ChoiceGroup styles={{ root: { width: 500 } }} label="Pick one icon" defaultSelectedKey="day" options={options} />

Items inside ChoiceGroup are wrapped with flexContainer which includes:

display: flex;
flex-wrap: wrap;

You can modify it if you need:

<ChoiceGroup styles={{ flexContainer: { flexWrap: 'nowrap' } }} defaultSelectedKey="day" options={options} />

Codepen working example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文