将 Materials-UI 添加到 Spring + thymeleaf 项目

VAN*_*LKA 2 css thymeleaf material-design

我想将此材料添加到我在 Springboot +thymeleaf https://getmdl.io 的项目中 我已将 material.min.css 复制到 resources/static/css 和 material.min.js 到 /resources/static 脚本。

在administration.html 中添加:

<link rel="stylesheet" th:href="@{css/material.min.css}"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" />
<script src="scripts/material.min.js" th:src="@{scripts/material.min.js}" type="text/javascript"/>
Run Code Online (Sandbox Code Playgroud)

但是当我使用输入类型 par 示例时,UI 没有动画。我该怎么做才有效。或者有另一种与百里香一起使用的好材料?

Raj*_*esh 5

添加 WebJar 版本的 Material Design lite Maven 后,我也面临同样的问题

  <dependency>
            <groupId>org.webjars.bower</groupId>
            <artifactId>material-design-lite</artifactId>
            <version>1.3.0</version>
  </dependency>
Run Code Online (Sandbox Code Playgroud)

(当时 1.3.0 是最新版本)

 <script src="webjars/material-design-lite/1.3.0/material.min.js"></script> 
Run Code Online (Sandbox Code Playgroud)

代替

<script src="scripts/material.min.js" th:src="@{scripts/material.min.js}" type="text/javascript"/>
Run Code Online (Sandbox Code Playgroud)

笔记:

<body>标签的所有页面内容(卡片,标签,导航栏),在容器<div>标签

<div class="container">
//All page contents kept here 
</div>
Run Code Online (Sandbox Code Playgroud)