导出后功能的描述是否被删除?

发布于 2025-01-18 18:03:26 字数 769 浏览 5 评论 0原文

因此,可以说我拥有一个非常好的功能,我想用const导出的功能是:

export const are = {
 
 you: function(){
   ...
 }
}

现在可以说,我添加了一个描述它的作用的颜色:

export const are = {
 /**
 * This functions does stuff :D
 */
 you: function(){
   ...
 }
}

虽然您可以从此脚本中查看描述,但似乎何时它已被导出并重新登录到另一个脚本中,它失去了描述。假设我有这个称为脚本的

import * as run from "run.js"
//and now lets say i call the function
run.are.you()
//when you type .you it just says the default text for a function

脚本

import {are} from "run.js";
are.you()
//when you type .you it still says the default text for a void function 

So lets say i have this really nice function i want to export with a const are:

export const are = {
 
 you: function(){
   ...
 }
}

And now lets say i added a decription to it that discribes what it does:

export const are = {
 /**
 * This functions does stuff :D
 */
 you: function(){
   ...
 }
}

Whilest you can view the description from this script, it seems as though when it has been exported and reimported into another script it loses its description. Lets say i have this script called script.js:

import * as run from "run.js"
//and now lets say i call the function
run.are.you()
//when you type .you it just says the default text for a function

If you try exporting it seperately like

import {are} from "run.js";
are.you()
//when you type .you it still says the default text for a void function 

Just to note I am using Visual Studio Code.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文