thymeleaf引入公共css、js等

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<th:block th:fragment="common_header">
    <!-- Common styles -->
    <meta charset="UTF-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" th:href="@{/favicon.ico}" type="image/x-icon" />
    <link rel="stylesheet" th:href="@{/resource/plugin/weAdmin/static/css/font.css}">
    <link rel="stylesheet" th:href="@{/resource/plugin/weAdmin/static/css/weadmin.css}">
</th:block>
 
代码引公共js
<th:block th:fragment="common_js">
    <!-- Common scripts -->
    <script type="text/javascript" th:src="@{/resource/plugin/weAdmin/lib/layui/layui.js}" charset="utf-8"></script>
</th:block>

  代码引用公共head

1
2
3
4
5
<head>
<title>haha</title>
<th:block th:replace="common::common_header" />
<link rel="stylesheet" th:href="@{/demo.css}" type="text/css" />
</head>

  

1
<th:block th:replace="common::common_js" />

  

 

posted @   星火卓越  阅读(1049)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 字符编码:从基础到乱码解决
历史上的今天:
2016-11-16 log4net 既要按日期分割日志文件,又要按文件大小分割。
2016-11-16 微信JS SDK配置授权,实现分享接口
2016-11-16 log4net的配置详解
2016-11-16 非常完善的Log4net详细说明
2016-11-16 log4net使用手册
2011-11-16 Js获取HTML中所有图片地址
点击右上角即可分享
微信分享提示