//下面的例子只供参考,并没有写完整的例子,给出了关键部分
//使用 th:fragment="topbar" 来把工公共部分抽取处理
//在别的页面引入公共片段common/bar代表common目录下的bar.html(抽取的公共页面)topbar代表从bar.html抽取的片段
//引入片段有三种方式 建议使用第2种方式
//下面代表上面的三种方式,对比就能看出区别
© 2011 The Good Thymes Virtual Grocery
© 2011 The Good Thymes Virtual Grocery
© 2011 The Good Thymes Virtual Grocery
//下面是讲的是frament表达式的使用,为了让某个在css在某个页面才能起作用
// 使用 th:class="${activeUri=='main.html'?'nav-link active':'nav-link'}"改变在不同的请求下,class有不同的css
//下面例子表示在{你的项目的相关路径}/main.html的请求下,a标签下的class="nav-link active",如果不是class="nav-link"
th:class="${activeUri=='main.html'?'nav-link active':'nav-link'}"
href="http://getbootstrap.com/docs/4.0/examples/dashboard/#">