亲宝软件园·资讯

展开

springboot bootcdn springboot bootcdn使用示例详解

o_瓜田李下_o 人气:0
想了解springboot bootcdn使用示例详解的相关内容吗,o_瓜田李下_o在本文为您仔细讲解springboot bootcdn的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点: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>

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

加载全部内容

相关教程
猜你喜欢
用户评论