我正在处理 Word 2016 加载项项目,但在使用 Office UI Fabric 库时遇到了一些困难。
基本上我想给我的加载项官方 Office 外观和感觉,所以我认为 Office UI Fabric 将是最好的选择,结合 Fabric javascript 组件,如下拉菜单等。
我安装了这两个 NuGet 包:OfficeUIFabric 2.6.3和OfficeUIFabricJS 1.4.0,然后我通过使用这些 css 类向页面添加了一些组件:“ms-Dropdown”、“ms-ChoiceField”和一些图标类,例如“ ms-图标--设置”。
这些是我得到的(奇怪的)结果:
OfficeUIFabric 和 OfficeUIFabricJS 提供同一个“fabric.components.css”文件的两个不同版本,因此最终结果取决于这两个包的安装顺序。
使用来自 OfficeUIFabric 2.6.3 的“fabric.components.css”,所有图标都丢失了,但 ChoiceField 的样式正确。
使用来自 OfficeUIFabricJS 1.4.0 的“fabric.components.css”,图标可见,但下拉按钮被绘制在矩形文本框外,并且 ChoicheField 的样式错误(标签换行,复选框是标准 HTML 控件)。
您对这些库有任何经验吗?我即将切换到更舒适的框架,例如 Bootstrap 或类似的...