Language-tools: 意外的标记。 你是说`{'>'}`还是`>`?

创建于 2020-05-30  ·  46评论  ·  资料来源: sveltejs/language-tools

svelte

描述错误
在一个完美的app.svelte文件中,我得到了上述内容。

系统(请填写以下信息):

  • 操作系统:Windows
  • IDE:VSCode
  • 插件/包:Svelte Beta
bug good first issue

所有46条评论

你能粘贴那个文件的完整代码吗?

这可能是因为在转换之前的代码缺少括号。 你能提供之前的代码吗?

<script>
  import { onMount } from "svelte";
  import u from "./Helper/utils.js";
  import msgbox from "./Components/msgbox.js";
  import Tabs from "./Components/tabs.svelte";
  import Button from "./Components/Button.svelte";
  import InboxTab from "./Main/Inbox.svelte";
  import ArchiveTab from "./Main/Archive.svelte";
  import HelpTab from "./Main/Help.svelte";
  import SettingsTab from "./Main/Settings.svelte";
  import DocOutTab from "./Main/DocOut.svelte";

  let mainid = "mainid";
  let server = "";
  let TABS;
  let timer = null;
  // let RTL = false;

  onMount(() => {
    u.addPrototypes();

    TABS.addtab({
      name: "inbox",
      description: "$Inbox$",
      icon: "gi-save-file", //icons.faFolderOpen
    });
    TABS.addtab({
      name: "docout",
      description: "$Docs Out$",
      icon: "gi-open-file", //icons.faFilter
    });
    TABS.addtab({
      name: "archive",
      description: "$Search Letters$",
      icon: "gi-search", //icons.faFilter
    });
    TABS.addtab({
      name: "settings",
      description: "$Settings$",
      icon: "gi-cog", // icons.faCog
    });
    TABS.addtab({
      name: "help",
      description: "$Help$",
      icon: "gi-question-sign",
    });

    setTimeout(() => {
      // kludge to get the server for fetch
      u.GET("/api/getuser").then((r) => (server = r));

      // server = window.ServerURL;
      u.GET("/api/inbox.getsettings").then((data) => {
        if (data.Color) {
          u.SetTheme(data.Color);
        }
        if (data.Language == "fa") {
          document.body.dir = "rtl";
          // document.documentElement.style.setProperty("--tblAlign", "right");
        }
      });
      TABS.setInitial();
    }, 0);

    // Heartbeat for auto update
    timer = setInterval(() => {
      u.GET("/api/getuser").catch(() => {
        clearInterval(timer);
        msgbox.Ok("$Connection Failed!$", "", () => window.location.reload(true));
      });
    }, 10 * 1000);
  });

  // register all tabs to be created here for Tab component
  function createTab(tabname, id, props) {
    var tab = null;

    switch (tabname) {
      case "inbox":
        tab = new InboxTab({
          target: document.getElementById(id),
        });
        break;
      case "help":
        tab = new HelpTab({
          target: document.getElementById(id),
        });
        break;
      case "archive":
        tab = new ArchiveTab({
          target: document.getElementById(id),
        });
        break;
      case "settings":
        tab = new SettingsTab({
          target: document.getElementById(id),
        });
        break;
      case "docout":
        tab = new DocOutTab({
          target: document.getElementById(id),
        });
        break;
    }

    return tab;
  }

  // function configeditor() {
  //   // console.log("here");
  // }
</script>

将给定的代码粘贴到入门模板的App.svelte中对我有用。 关于您的设置或文件,我们还应该了解什么?

我不是专家,所以你必须告诉我要寻找什么/在哪里。

您还可以提供标记和 skyle 标签吗?

我找到了罪魁祸首:

<svelte:head>
  <link rel="stylesheet" href="/lib/jodit.es2018.min.css" />
  <script src="/lib/jodit.es2018.min.js"> 

  </script>
</svelte:head>

head部分中的script标记弄乱了解析器。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

vatro picture vatro  ·  3评论

maximedupre picture maximedupre  ·  5评论

Kingwl picture Kingwl  ·  6评论

JAD3N picture JAD3N  ·  5评论

scippio picture scippio  ·  3评论