• 个人中心标签页导航


    新页面userbase.html,用<ul ><li role="presentation"> 实现标签页导航。
    <ul class="nav nav-tabs">
      <li role="presentation"><a href="#">Home</a></li>
      <li role="presentation"><a href="#">Profile</a></li>
      <li role="presentation"><a href="#">Messages</a></li>
    </ul>

    1. 让userbase.html继承base.html。
      重写title,head,main块.
      将上述<ul>的样式放在head块,<ul>放在main块中.
      定义新的块user。

    2. 让上次作业完成的个人中心页面,继承userbase.html,原个人中心就自动有了标签页导航。

    3. 制作个人中心的三个子页面,重写userbase.html中定义的user块,分别用于显示问答、评论、个人信息。

    4. 思考 如何实现点标签页导航到达不同的个人中心子页面。
    @app.route('/usercenter/<user_id>/<tag>')
    @loginFirst
    def usercenter(user_id,tag):
        user=User.query.filter(User.id==user_id).first()
        context={
            'user':user,
            'question': user.question,
            'comments': user.comments
        }
        if tag=='1':
            return render_template('usercenter1.html', **context)
        elif tag=='2':
            return render_template('usercenter2.html', **context)
        else:
            return render_template('usercenter3.html', **context)
  • 相关阅读:
    1. Change the emulator screen size
    Dynamic Programming for TSP
    框架的概念及用反射技术开发框架的原理
    【PHP 】 伪静态
    【PHP 】伪静态
    框架-Java:Spring MVC
    开源-解决方案-实时数据追踪:Zipkin 介绍
    报表-类型:瀑布图
    报表:目录
    软件-开发软件-Java-Eclipse:百科
  • 原文地址:https://www.cnblogs.com/1244581939cls/p/8042233.html
Copyright © 2020-2023  润新知