springboot bootcdn使用示例详解
应用:直接使用bootcdn提供的静态资源,不需要本地存储
bootcdn 官网:https://www.bootcdn.cn/
staticfile cdn官网: http://www.staticfile.org/
常用静态资源
# layui.js https://cdn.bootcdn.net/ajax/libs/layui/2.6.8/layui.js https://cdn.bootcdn.net/ajax/libs/layui/2.6.8/layui.min.js # layui.css //unpkg.com/layui@2.6.8/dist/css/layui.css https://www.layuicdn.com/layui-v2.6.8/css/layui.css # jquery https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js # bootstrap https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap-grid.css https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap-grid.min.css # react https://cdn.bootcdn.net/ajax/libs/react-is/0.0.0-experimental-6f3fcbd6f-20210730/cjs/react-is.development.js https://cdn.bootcdn.net/ajax/libs/react-is/0.0.0-experimental-6f3fcbd6f-20210730/cjs/react-is.development.min.js # vue https://cdn.bootcdn.net/ajax/libs/vue/3.2.0-beta.7/vue.cjs.js https://cdn.bootcdn.net/ajax/libs/vue/3.2.0-beta.7/vue.cjs.min.js
*********************
示例
***************
配置文件
cdn.properties
layui=https://cdn.bootcdn.net/ajax/libs/layui/2.6.8/layui.min.js jquery=https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js
***************
前端页面
index.html
<!DOCTYPE html> <html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta charset="UTF-8"> <title>Title</title> <script th:src="${application.jquery}"></script> <script th:src="${application.layuijs}"></script> <link rel="stylesheet" th:href="${application.layuicss}"> <!-- <script> $(function (){ $("#btn").click(function (){ alert("hello world"); }) }) </script>--> <script> layui.use('layer',function (){ var layer=layui.layer; $("#btn").click(function (){ $("#1").html("瓜田李下<br>"); layer.msg('hello') }) }) </script> </head> <body> <div th:align="center"> <span id="1" style="background-color: purple;font-size: large"></span><br> <button id="btn" class="layui-btn">点击一下</button> </div> </body> </html>
*********************
到此这篇关于springboot bootcdn使用的文章就介绍到这了,更多相关springboot bootcdn内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
有关ServletConfig与ServletContext的访问
下面小编就为大家带来一篇有关ServletConfig与ServletContext的访问。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧2017-01-01ConcurrentModificationException日志关键字报警思考分析
本文将记录和分析日志中的ConcurrentModificationException关键字报警,还有一些我的思考,有需要的朋友可以借鉴参考下,希望能够有所帮助2023-12-12详解Java8新特性之interface中的static方法和default方法
这篇文章主要介绍了Java8新特性之interface中的static方法和default方法,非常不错,具有一定的参考借鉴价值,需要的朋友可以参考下2018-08-08
最新评论