我的标题有不同的链接到我的网络应用程序的子部分:
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<!-- Left -->
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link waves-effect" href="{{ url_for('homepage') }}">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link waves-effect" href="{{ url_for('dashboards') }}" target="_blank">Dashboards</a>
</li>
<li class="nav-item">
<a class="nav-link waves-effect" href="{{ url_for('support')}}" target="_blank">Support</a>
</li>
</ul>
</div>
虽然主页始终在同一选项卡中打开,但任何其他导航栏项目都会作为新选项卡打开。如何预防?以下所有模板都扩展了标头。
@app.route('/')
def homepage():
return render_template('mainpage.html')
@app.route('/dashboards/')
def dashboards():
return render_template('dashboards.html',
labels=sample_data.index,
data=sample_data['Resource ID'],
max_instances=max_instances,
running_instances=running_instances)
@app.route('/support/')
def support():
return render_template('support.html')
慕森王
相关分类