美文网首页
thymeleaf模板继承

thymeleaf模板继承

作者: berger_w | 来源:发表于2018-12-11 09:39 被阅读0次

Thymeleaf 依赖

<dependency>

<groupId>org.springframework.boot</groupId>

<artifactId>spring-boot-starter-thymeleaf</artifactId>

</dependency>

默认的配置足够了,不需要改了。

模板继承

<html xmlns:th="http://www.thymeleaf.org"

      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"

      layout:decorator="layout">

<div class="container"layout:fragment="content"></div>

layout:fragment="content" 是子类引用layout 模板 预定义的模板接口

相关文章

网友评论

      本文标题:thymeleaf模板继承

      本文链接:https://www.haomeiwen.com/subject/srmthqtx.html