导出嵌套变量
当我尝试解释时,请忍受我。一旦从嵌套变量满足IF语句后,我想导出一个值,然后将其导入另一个.ts文件。
例子。
var create = {
if(condition == true){
var x = 3;
export x;
}
else return;
}
然后完成
import { x } from "./List"
if(x == 3){
make condition here true.
}
Please bear with me as I try to explain. I would like to export a value once the if statement is satisfied from a nested variable, then import this into another .ts file.
Example.
var create = {
if(condition == true){
var x = 3;
export x;
}
else return;
}
then when its done
import { x } from "./List"
if(x == 3){
make condition here true.
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有几件事要注意:
考虑到这一点,您可能需要的是设置一个变量,该变量将根据您的条件设置为不同的值,然后始终导出它。这样的事情:
There are a couple of things to note here:
Taking this into account, what you probable need is to set a variable that will be set to different values depending on your conditions and then always export it. Something like this: