Office JS样式表与HTML编辑器

发布于 2025-02-11 03:40:44 字数 600 浏览 1 评论 0原文

因此,我正在尝试构建一个办公室添加,我选择了Visual Studio认为,由于它具有本机对Office JS的支持,因此可以使用Office UI Fabric添加为Office JS格式化的HTML代码。

问题在于,当您尝试在.html文件上编辑HTML Web编辑器模式中的任何属性时,就会出现错误,说您无权编辑CSS文件。这是令人惊讶的,但并不意外。该文件是您从Office UI面料导入的远程样式表。不是你自己做的。这是只读文件。但是,如果您尝试手动编辑HTML,则内置的Intelisense将自动从链接的样式表中为您完成类属性。

我期望发生的是VS看到链接的CSS文件,然后去“哦,我有这些HTML属性的选项”,只需在某个地方给我一个干净的下拉菜单,以根据外部CSS修改Web编辑器中的元素。相反,发生的事情是,它试图将其放置在普通的HTML属性中,而无需考虑样式表。

我要驾驶的真正问题是,有没有办法使我根据预制的链接CSS文件给我属性选项?我是VS的新手,所以我可能只是无知,但是几个小时在Google上搜索的结果很少。我无法想象某人如果尚不存在的话,就没有制作此功能,我不禁会觉得我缺少一些愚蠢的东西。如果不是这样,我对HTML足够满意,可以通过老式的方式混淆,但是在这个时代似乎很愚蠢。

So I'm trying to build an office add in and I opted for Visual Studio thinking that since it has native support for Office JS it would have the ability to add in HTML code formatted for Office JS using the Office UI Fabric.

The problem is that when you try to edit any of the properties in HTML web editor mode on the .html files it pings you with an error saying you don't have permission to edit the CSS file. This is surprising but not unexpected. The file is a remote style sheet you are importing from Office UI Fabric. Not one you made yourself. It's a read only file. However, if you try and edit the HTML manually, there is intelisense built in that will auto complete the class attributes for you from the linked stylesheet.

What I expected to happen was for VS to see the linked CSS file and go "Oh, I have options for these HTML attributes" and just give me a clean drop down menu somewhere to modify the elements in Web Editor based on the external CSS. What happens instead is that it tries to place in normal HTML attributes with no regard for the style sheet.

The real question I'm driving at is, is there a way to make VS give me attribute options based on premade linked CSS files? I am admittedly new to VS so I might just be ignorant but several hours of searching on google has yielded very little results. I can't imagine someone hasn't made this functionality if it doesn't already exist and I can't help but feel I'm missing something stupidly obvious. If not, I'm comfortable enough with HTML to muddle through the old fashioned way but it seems silly in this age to have to.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文