1

我正在尝试在单个页面中将 Emmet 与 Ace 的预打包版本一起使用。`

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Ace & Emmet Pack</title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <style type="text/css">
        #editor { font-size: 12pt; font-family: monospace; }
    </style>
</head>
<body>
    <pre id="editor"></pre>
    <script text="type/javascript" src="https://cloud9ide.github.io/emmet-core/emmet.js"></script>
    <script text="type/javascript" src="ace/demo/r.js/packed.js"></script>
    <script text="type/javascript">
        require("ace/config").set("basePath", "ace/build/src");
        require("ace/config").set("packaged", true);
        const editor = require("ace/ace").edit("editor");
        editor.session.setMode("ace/mode/html");
        editor.setOptions({
            maxLines: 25,
            autoScrollEditorIntoView: true
        });
        editor.setValue(
            "<p>Hello the World !</p>\n" +
            "<p>packed.js was built as explained in ace/demo/r.js/</p>\n" +
            "<p>Emmet is not working !</p>\n"
        );
        var Emmet = require("ace/config").loadModule(
            "ace/ext/emmet",
            function(module) {
                editor.setOption("enableEmmet", true);
            }
        );
    </script>
</body>
</html>`

但我有以下错误:错误:ace/ext/emmet 缺少资源 packed.js:314:27

我的页面有什么问题?

4

0 回答 0