簡體   English   中英

谷歌關閉 - goog.require 找不到 goog.structs.PriorityQueue

[英]Google closure - goog.require could not find goog.structs.PriorityQueue

我正在嘗試使用 Google Closure 提供的 PriorityQueue 功能,但如果不使用 Closure 編譯器,我似乎無法弄清楚如何做到這一點。 由於我沒有使用任何自定義模塊,看來我不需要使用編譯器。

我的文件夾結構如下:

/Project/html/index.html
/Project/ThirdParty/closure-library

我的 index.html 文件包含:

<html>
<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <script type="text/javascript" src="../ThirdParty/closure-library/closure/goog/base.js"></script>
    <script>
        goog.require('goog.structs');
        goog.require('goog.structs.PriorityQueue');
    </script>
</head>
<body></body>
</html>

然而,上面給了我以下信息:

goog.require could not find: goog.structs
goog.require could not find: goog.structs.PriorityQueue

我有點不知所措,因為我的代碼似乎與https://developers.google.com/closure/library/docs/gettingstarted中給出的示例一致

你是怎么找回圖書館的? 如果你“npm install”,你應該在 base.js 旁邊有一個 deps.js 文件,這應該是你需要的一切。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM