1

我在 html 文件中使用了 xterm.js,通过 src 导入 xterm.js:

<head>
  <link rel="stylesheet" href="/static/plugins/xterm/dist/xterm.css" />
  <link rel="stylesheet" href="/static/plugins/xterm/dist/addons/fullscreen/fullscreen.css" />
  <script src="/static/plugins/xterm/dist/xterm.js"></script>
  <script src="/static/plugins/xterm/dist/addons/fullscreen/fullscreen.js"></script>
</head>

  <script>
     var term = new Terminal();
     term.open(element);
  </script>

如何应用全屏插件?我参考了官方链接: https ://xtermjs.org/docs/api/addons/fullscreen/ 但不适合我!

4

1 回答 1

3

您必须Terminal.applyAddon(fullscreen);var term = new Terminal();.

于 2018-11-05T00:18:48.707 回答