![](/img/trans.png)
[英]Is it possible to print the line number with JavaScript to Console or Execution Log on NetSuite?
[英]If print the console log, it is normal. but execution is empty
<Body title="User List" subTitle="유저 목록 페이지입니다." store={this.props.store}>
<Sidebar store={this.props.store}/>
插入 2 深度。
setSidebar = () => {
const url = `${API_URI.SIDEBAR}?token=${this.props.store.token}`;
console.log(url) // token is not empty
axios.get(url).then((data: any) => {
this.setState({activeUrls:
data.data.map((sidebar: any) => {
const path = this.getSidebarPath(sidebar);
return sidebar.allowed ?
<li key={sidebar.key} className="nav-item">
<Link href={path}><a href={path} className="nav-link">
<i className={sidebar.icon}></i>
<span>{sidebar.title}</span>
</a></Link>
</li> : <li></li>
})
});
});
}
componentDidMount() {
{this.setSidebar()};
}
此代码不是空令牌值。
获取 http://localhost:8000/apis/sidebar?token=500
如果打印控制台日志,则是正常的。 但执行是空的。
您的代码有两个问题:
您应该做的是将数据本身存储在状态上并在渲染时使用 t:
render(){
return ...
{this.state.ajaxData && ...}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.