您的位置:首页技术文章
文章详情页

springboot bootcdn使用示例详解

【字号: 日期:2023-02-18 08:20:36浏览:14作者:猪猪

应用:直接使用bootcdn提供的静态资源,不需要本地存储

bootcdn 官网:https://www.bootcdn.cn/

staticfile cdn官网: http://www.staticfile.org/

常用静态资源

# layui.jshttps://cdn.bootcdn.net/ajax/libs/layui/2.6.8/layui.jshttps://cdn.bootcdn.net/ajax/libs/layui/2.6.8/layui.min.js # layui.css//unpkg.com/layui@2.6.8/dist/css/layui.csshttps://www.layuicdn.com/layui-v2.6.8/css/layui.css # jqueryhttps://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.jshttps://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js # bootstraphttps://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap-grid.csshttps://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/5.0.2/css/bootstrap-grid.min.css # reacthttps://cdn.bootcdn.net/ajax/libs/react-is/0.0.0-experimental-6f3fcbd6f-20210730/cjs/react-is.development.jshttps://cdn.bootcdn.net/ajax/libs/react-is/0.0.0-experimental-6f3fcbd6f-20210730/cjs/react-is.development.min.js # vuehttps://cdn.bootcdn.net/ajax/libs/vue/3.2.0-beta.7/vue.cjs.jshttps://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.jsjquery=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='https://www.haobala.com/bcjs/${application.jquery}'></script> <script th:src='https://www.haobala.com/bcjs/${application.layuijs}'></script> <link rel='stylesheet' th:href='https://www.haobala.com/bcjs/${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 style='background-color: purple;font-size: large'></span><br> <button class='layui-btn'>点击一下</button></div></body></html>

*********************

到此这篇关于springboot bootcdn使用的文章就介绍到这了,更多相关springboot bootcdn内容请搜索好吧啦网以前的文章或继续浏览下面的相关文章希望大家以后多多支持好吧啦网!

标签: Spring
相关文章: