gpt4 book ai didi

javascript - Google-closure : What's the difference between Goog. 提供与 Goog.require

转载 作者:行者123 更新时间:2023-12-03 08:11:30 24 4
gpt4 key购买 nike

谁能告诉我其中的区别。我刚刚开始关闭谷歌。

最佳答案

goog.provide 创建一个命名空间; goog.require 从给定 namespace “导入”代码,以便闭包编译器可以找到它。

通常,当您创建一个类时,您将为其提供一个命名空间,并需要您的类直接使用的所有命名空间。

更多信息(和示例)在这里:https://developers.google.com/closure/library/docs/tutorial

关于javascript - Google-closure : What's the difference between Goog. 提供与 Goog.require,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34126086/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com