【问题标题】:SPFx: Problem with loading schema in manifest JSONSPFx:在清单 JSON 中加载架构时出现问题
【发布时间】:2020-03-11 06:41:14
【问题描述】:

我在为 SP 的新 Web 部件中加载 SPFx 中的 $schema 时遇到问题。 Web 部件正在处理 benchmark.aspx,但我的整个清单没有被处理,所以我无法设置 preconfiguredEntries,这对我来说是个大问题。

错误是: 加载参考“https://developer.microsoft.com/json-schemas/spfx/client-side-manifest-base.schema.json”时出现问题:请求 vscode/content 意外失败,未提供任何详细信息。(768)

请对这个问题有任何想法?

{
  
  "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", 
    
  "id": "56dab116-67ba-453f-883d-b7a11690e965",
  "alias": "ReadListWebPart",
  "supportedHosts": ["SharePointWebPart"],
  "componentType": "Webpart", 
  
  "version": "1.0",
  "manifestVersion": "2",

  
  "requiresCustomScript": false,
  

  "preconfiguredEntries": [{
    "groupId": "5c03119e-3074-46fd-976b-c60198311f70", 
    "group": { "default": "Other" },
    "title": { "default": "read-list" },
    "description": { "default": "popis web party" },
    "officeFabricIconFontName": "Page",
    "properties": {
      "vedouci_velke_foto": true,
      "asistenti_pod_vedoucim": false, 
      "nazev_web_party": "To jsme my"   
    }
  }]
}

【问题讨论】:

    标签: sharepoint jsonschema web-parts spfx manifest.json


    【解决方案1】:

    我检查了 manifest.json,和你的一样,有以下警告:

    然后测试在我本地访问“https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json”,没问题,还是可以访问的。

    在此之后,我测试在 React SPFX Web 部件中输出预配置的属性,如下所示:

    道具.ts

    WebPart.ts

    .tsx

    仍然可以输出属性:

    总之,你可以忽略这个问题,它仍然能够读取预配置条目。

    【讨论】:

    • 非常感谢,它可能真的没有任何效果,它还帮助我意识到 manifest.json 在“gulp serve”期间正在被翻译,并且我无法仅通过F5工作台
    • 嗨 Vochomurka,是的,使用 gulp serve,它可以按预期运行。如果我的回复对你有帮助,你可以选择接受作为答案,这样可以帮助论坛里有类似问题的其他人。非常感谢:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-05
    • 1970-01-01
    • 2014-10-19
    相关资源
    最近更新 更多