web前端之选项卡集合、动态添加类名、动态移除类名、动态添加样式、激活、间距、节流、tabBar

news2024/9/24 3:20:01

MENU

  • input的checked属性(Html+Style)
  • 伪元素(Html+Style+JavaScript)
  • 激活类(Html+Style+JavaScript)
  • vue伪元素


input的checked属性(Html+Style)

前言

代码段创建一个使用HTML和CSS实现的标签式内容切换组件。通过选择不同的标签,可以展示相应的内容。
代码段实现一个简洁的标签切换组件,当用户点击不同的标签时,显示相应的内容。每个标签的样式在选中时会改变,未选中的内容会被隐藏。这个组件在需要多个内容区域的情况下非常有用,比如网页的导航栏、选项卡式的内容展示等。


效果图

默认


激活


激活


Html

<div class="box">
    <input id="idRadio1" type="radio" name="option" checked />
    <label for="idRadio1">
        <div class="tab_bar">Home</div>
        <div class="content">
            Home Lorem ipsum dolor, sit amet consectetur adipisicing elit. Sunt cumque quasi at veritatis
            necessitatibus
            quisquam nobis ipsa, sapiente incidunt ullam maiores, provident impedit eaque libero recusandae
            neque
            omnis aperiam? Voluptatibus.
        </div>
    </label>

    <input id="idRadio2" type="radio" name="option" />
    <label for="idRadio2">
        <div class="tab_bar">Blog</div>
        <div class="content">
            Blog Lorem ipsum dolor sit amet consectetur adipisicing elit. Quia magnam eius vel distinctio a odit
            tempore!
            Odit libero voluptatibus accusamus placeat, nobis enim quo ratione nostrum nesciunt commodi, sit
            voluptatum.
            Repudiandae alias consequuntur praesentium iure eos nesciunt fuga iste. Natus libero cum quidem
            commodi
            ipsam magni, nobis laudantium eum quae error velit sed accusamus voluptatem alias earum incidunt
            temporibus dolorem.
        </div>
    </label>

    <input id="idRadio3" type="radio" name="option" />
    <label for="idRadio3">
        <div class="tab_bar">Shop</div>
        <div class="content">
            Shop Lorem ipsum, dolor sit amet consectetur adipisicing elit. Vitae sequi recusandae unde dolorum eum
            iure
            ipsam quae nihil deserunt facilis omnis doloribus illum similique sunt, corporis minus nemo quaerat
            est?
            Iste blanditiis nulla culpa, quidem, facere explicabo beatae enim assumenda aspernatur nemo incidunt
            animi quis ab esse laudantium impedit sed ipsam fuga molestias? Quibusdam pariatur aliquam,
            explicabo
            esse vero incidunt!
            Aspernatur suscipit quidem sunt at in! Officia, quas blanditiis aut magnam quo harum dignissimos, et
            perspiciatis similique dolorem quaerat dolore placeat fuga obcaecati natus quam deserunt maiores
            eius
            accusamus praesentium.
        </div>
    </label>

    <input id="idRadio4" type="radio" name="option" />
    <label for="idRadio4">
        <div class="tab_bar">News</div>
        <div class="content">
            News Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem earum quo aspernatur, facere nobis
            impedit accusantium adipisci. Minima harum, libero pariatur, natus nulla molestiae sit ex, error dolores
            iusto ipsam.
            Mollitia nisi molestiae nemo voluptate praesentium suscipit, impedit repudiandae at ratione architecto
            rerum? Quos, expedita quod. Voluptas molestiae, molestias ipsam ad laudantium amet eveniet facilis fuga
            perferendis similique dignissimos illum.
            Iure ea sit, dolorem sed quos, vel assumenda sint distinctio iusto facere, quasi mollitia! Provident
            magni harum nemo rem expedita autem quaerat in ea enim placeat assumenda, unde aut similique!
            Ullam, distinctio. Ea optio perferendis, provident rem iste eveniet molestias consectetur mollitia in
            itaque iure explicabo dolorem autem, laudantium ducimus cum libero aut nihil ut minus eligendi. Officia,
            iste laboriosam.
        </div>
    </label>
</div>

1、<div class="box">是一个包含整个组件的容器。
2、<input type="radio" />是一系列的单选按钮,用于选择不同的标签。这些按钮隐藏,并通过CSS与标签和内容关联。
3、<label>每个标签和其对应的内容都被包含在一个<label>标签中,点击时会触发关联的单选按钮。
4、<div class="tab_bar">是每个标签的可视部分,显示为用户点击的选项,如“Home”、“Blog”等。
5、<div class="content">是对应于每个标签的内容部分,默认情况下隐藏,只有选中的标签对应的内容会被显示。


Style

body {
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 28px;
    box-sizing: border-box;
    background-color: #a17a7a;

    .box {
        position: relative;
        display: flex;

        >input {
            display: none;
        }

        >input:checked+label .tab_bar {
            background-color: rgb(243, 240, 58);
            color: #333333;
        }

        >input:checked+label .content {
            display: block;
            z-index: 1;
        }

        >label {
            .tab_bar {
                padding: 10px;
                box-sizing: border-box;
                background-color: rgba(255, 255, 255, 0.5);
                color: #ffffff;
                cursor: pointer;
                transition: 0.25s;
            }

            .content {
                width: 100%;
                position: absolute;
                top: 50px;
                left: 0;
                padding: 10px;
                box-sizing: border-box;
                background-color: #ffffff;
                box-shadow: 0px 0px 6px #333333 inset;
                border-radius: 2px;
                color: #333333;
                display: none;
                z-index: 0;
            }
        }

        >label:nth-child(2)>.tab_bar {
            border-top-left-radius: 2px;
            border-bottom-left-radius: 2px;
        }

        >label:last-child>.tab_bar {
            border-top-right-radius: 2px;
            border-bottom-right-radius: 2px;
        }
    }
}

body设置页面的基本样式,宽度和高度为100%,背景颜色为浅棕色。
.box是整个标签组件的容器,设置为相对定位和水平排列。
input[type="radio"]所有的单选按钮都被隐藏(display: none;)。
input:checked + label .tab_bar当单选按钮被选中时,关联的标签样式会改变,背景颜色变为黄色,文字颜色变为深灰色。
input:checked + label .content当单选按钮被选中时,关联的内容部分会被显示(display: block;),并且设置较高的层级(z-index: 1;)。
.tab_bar标签的基础样式,设置背景颜色、文字颜色、内边距、边框等属性,并且增加鼠标悬停时的样式过渡效果。
.content内容部分的基础样式,设置宽度、位置、内边距、背景颜色、阴影效果、圆角边框等属性。默认情况下隐藏(display: none;),仅在选中状态下显示。
nth-child(2)和last-child通过选择器调整标签的圆角,使得第一个和最后一个标签有不同的边框圆角样式,增强视觉效果。


伪元素(Html+Style+JavaScript)

效果图

默认


激活


html
代码

<div class="card">
    <div class="tab_bar">
        <div class="item" onclick="handleTabBar(this)">tabBar1</div>
        <div class="item" onclick="handleTabBar(this)">tabBar2</div>
        <div class="item" onclick="handleTabBar(this)">tabBar3</div>
    </div>

    <div class="content">
        <div class="item">
            <h2>Tab1</h2>
            <p>Content for Tab 1.</p>
        </div>
        <div class="item">
            <h2>Tab2</h2>
            <p>Content for Tab 2.</p>
        </div>
        <div class="item">
            <h2>Tab3</h2>
            <p>Content for Tab 3.</p>
        </div>
    </div>
</div>

解析

1、整个代码块的外层是一个<div>标签,类名为card,表示这是一个卡片样式的容器。
2、tab_bar部分包含三个div元素,每个div元素都具有item类,并且每个div元素有一个onclick事件,当用户点击时,会调用handleTabBar(this)函数。
2.1、tabBar1、tabBar2和tabBar3是三个不同的标签,每个标签都会显示不同的内容。
3、content部分也包含了三个div元素,每个div元素都具有item类,对应不同的标签页内容。


style
代码

.card {
    padding: 8px;
    box-sizing: border-box;
    background-color: #ffffff;
    box-shadow: 0px 0px 2px 2px #fafad2;
    border-radius: 4px;

    .tab_bar {
        display: flex;
        padding-bottom: 8px;
        box-sizing: border-box;
        border-bottom: 1px solid #e1e1e1;

        .item {
            padding: 4px 8px;
            box-sizing: border-box;
            cursor: pointer;
        }

        .item:not(:first-child) {
            margin-left: 6px;
        }

        .active {
            position: relative;
            color: #409eff;
            transition: color 0.3s ease;
        }

        .active::after {
            content: '';
            position: absolute;
            width: 68%;
            height: 3px;
            left: 50%;
            bottom: -2px;
            transform: translateX(-50%);
            background-color: #409eff;
            border-radius: 2px;
        }
    }

    .content {
        margin-top: 8px;

        .item {
            display: none;

            h2 {
                margin: 0;
            }

            p {
                margin: 0;
                margin-top: 4px;
            }
        }
    }
}

解析

1、.card定义卡片的基本样式,包括内边距、背景色、阴影效果和边框圆角。
2、.tab_bar是标签栏的样式,使用display: flex;使其成为一个水平排列的布局。每个.item元素有内边距,并且设置鼠标悬停时的样式cursor: pointer;表明它是可点击的。
3、.item:not(:first-child)定义非第一个item的左边距,使其与前一个元素有一定的间隔。
4、.active类表示当前激活的标签,改变文字颜色,并添加一个下划线,表示当前激活的状态。
5、.content .item隐藏所有内容,除非被激活。


JavaScript
代码

runInit();

function handleTabBar(e) {
    const itemElTabBar = document.querySelectorAll('.tab_bar .item');
    const itemElContent = document.querySelectorAll('.content .item');

    itemElTabBar.forEach((item, i) => {
        if (item === e) {
            e.classList.add('active');
            itemElContent[i].style.display = 'block';
        } else {
            item.classList.remove('active');
            itemElContent[i].style.display = 'none';
        }
    });
}

function runInit() {
    const itemElTabBar = document.querySelectorAll('.tab_bar .item');
    const itemElContent = document.querySelectorAll('.content .item');

    itemElTabBar[0].classList.add('active');
    itemElContent[0].style.display = 'block';
}

解析

1、runInit()函数在页面加载时立即运行,初始化第一个标签页,使其显示为激活状态。
2、handleTabBar(e)函数在用户点击任意一个标签时触发。
2.1、itemElTabBar和itemElContent分别获取.tab_bar和.content下的所有item元素。
2.2、遍历所有的item元素,检查当前点击的item是否与遍历中的item相同。
2.2.1、如果是相同的,将其设置为激活状态(添加active类),并显示对应的内容。
2.2.2、如果不是相同的,则移除active类,并隐藏对应的内容。


激活类(Html+Style+JavaScript)

效果图

默认1


激活1


激活2


动态图


概述

代码段实现一个简单的图片展示和切换功能,用户可以通过点击下方的缩略图来更改上方的大图显示。代码主要由HTML结构、CSS样式和JavaScript交互逻辑组成。


html

<div class="box">
    <div class="back_img"></div>
    <ul class="list">
        <li class="item">
            <img class="active" src="../../image/2_.jpg" alt="">
        </li>
        <li class="item">
            <img src="../../image/5_.jpg" alt="">
        </li>
        <li class="item">
            <img src="../../image/10_.jpg" alt="">
        </li>
        <li class="item">
            <img src="../../image/3_.jpg" alt="">
        </li>
        <li class="item">
            <img src="../../image/1_.jpg" alt="">
        </li>
    </ul>
</div>

1、<div class="box">是整个组件的容器,包含大图显示区域和缩略图列表。
2、<div class="back_img"></div>用于显示大图的区域,初始状态下没有内容,背景图像会通过CSS设置。
3、<ul class="list">是缩略图列表,包含多个缩略图供用户选择。
3.1、<li class="item">列表项,每个项包含一张缩略图。
3.2、<img>实际的缩略图图片。
3.3、第一张图片具有class="active"类,表示默认选中的状态,对应显示在大图区域。


HTML结构简单明了,清晰地分隔大图显示区域和缩略图列表,方便后续样式和交互的实现。


style

* {
    margin: 0px;
    padding: 0px;
    box-sizing: border-box;
}

body {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(to bottom, pink, skyblue);

    .box {
        width: 680px;

        .back_img {
            height: 500px;
            background-image: url('../../image/2_.jpg');
            background-repeat: no-repeat;
            background-size: 100% 100%;
            box-shadow: 0px 0px 1px 2px rgba(255, 165, 0, 1);
            border-radius: 4px;
            transition: all 1s;
        }

        .list {
            width: 100%;
            height: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 18px;
            list-style: none;
            gap: 16px;

            .item {
                flex: 1;
                height: 118px;

                img {
                    width: 100%;
                    height: 100%;
                    box-shadow: 0px 0px 1px 2px rgba(68, 68, 68, 0.4);
                    border-radius: 4px;
                    cursor: pointer;
                }

                img.active {
                    box-shadow: 0px 0px 1px 2px rgba(255, 165, 0, 1);
                }
            }
        }
    }
}

全局样式*
1、margin: 0px;padding: 0px;清除所有元素的默认外边距和内边距,保证样式的一致性。
2、box-sizing: border-box;设置盒模型计算方式,元素的宽高包括内边距和边框,方便尺寸控制。


body样式
1、width: 100vw;height: 100vh;设置视口宽高为 100%,充满整个浏览器窗口。
2、display: flex;使用Flexbox布局。
3、justify-content: center;align-items: center;将内容在水平方向和垂直方向居中对齐。
4、background: linear-gradient(to bottom, pink, skyblue);设置从上到下的线性渐变背景色,颜色从粉色过渡到天蓝色。


.box容器样式
1、width: 680px;设置容器的宽度。


.back_img
1、height: 500px;设置高度。
2、background-image: url('../../image/2_.jpg');设置初始背景图像,与第一张缩略图对应。
3、background-repeat: no-repeat;防止背景图像重复。
4、background-size: 100% 100%;让背景图像充满整个容器并拉伸到容器尺寸。
5、box-shadow: 0px 0px 1px 2px rgba(255, 165, 0, 1);添加橙色的外阴影,增加层次感。
6、border-radius: 4px;设置圆角,增加柔和感。
7、transition: all 1s;添加过渡效果,使背景图像更换时有平滑的过渡。


.list
1、display: flex;使用Flexbox布局。
2、justify-content: space-between;在主轴(水平)方向上均匀分布子元素。
3、align-items: center;在交叉轴(垂直)方向上居中对齐。
4、margin-top: 18px在顶部添加间距,与大图区域分隔开。
5、list-style: none;去除列表默认样式。
6、gap: 16px;设置子元素之间的间距。


.item
1、flex: 1;每个缩略图项平均分配剩余空间,保证等宽。
2、height: 118px;设置高度。


img
1、width: 100%;height: 100%;让图片充满父容器。
2、box-shadow: 0px 0px 1px 2px rgba(68, 68, 68, 0.4);添加灰色的外阴影。
3、border-radius: 4px;设置圆角。
4、cursor: pointer;当鼠标悬停时显示指针,提示可点击。


img.active
1、box-shadow: 0px 0px 1px 2px rgba(255, 165, 0, 1);为选中的缩略图添加橙色的外阴影,突出显示。


CSS样式通过精心设计,实现良好的布局和视觉效果,但需要注意的是,嵌套语法需要借助Sass等CSS预处理器进行编译。如果在浏览器中直接使用,需要将嵌套的样式展开为标准的CSS语法。


JavaScript

runInit();

function runInit() {
    const backImg = document.querySelector('.back_img');
    const elList = document.querySelectorAll('.item > img');
    let isClick = true;

    elList.forEach(item => {
        item.onclick = ({ target }) => {
            if (isClick) {
                backImg.style.backgroundImage = `url(${target.src})`;
                elList.forEach(items => items.classList.remove('active'));
                target.classList.add('active');
                isClick = false;
                setTimeout(() => isClick = true, 1000 * 1);
            }
        };
    });
}

1、runInit();调用初始化函数,开始执行交互逻辑。
2、function runInit() { ... }定义初始化函数。
2.1、const backImg = document.querySelector('.back_img');获取大图显示区域的DOM元素,方便后续修改其背景图像。
2.2、const elList = document.querySelectorAll('.item > img');获取所有缩略图图片的DOM元素集合,便于为每个缩略图添加点击事件。
2.3、let isClick = true;定义一个布尔值变量,用于控制点击节奏,防止过于频繁的点击操作。
3、为每个缩略图添加点击事件监听器。
3.1、elList.forEach(item => { ... });遍历每个缩略图元素,为其添加点击事件。
3.2、item.onclick = ({ target }) => { ... };当缩略图被点击时触发的事件处理函数。
3.3、if (isClick) { ... }检查isClick是否为true,防止在短时间内多次触发点击事件。
3.4、backImg.style.backgroundImage = 'url(' + target.src + ');'将大图区域的背景图像设置为被点击的缩略图的src,实现大图切换。
3.5、elList.forEach(items => items.classList.remove('active'));移除所有缩略图的active类名,取消选中状态。
3.6、target.classList.add('active');为当前被点击的缩略图添加active类名,突出显示选中状态。
3.7、isClick = false;将isClick设置为false,防止在短时间内再次触发点击事件。
3.8、setTimeout(() => isClick = true, 1000 * 1);
3.8.1、使用setTimeout在1秒后将isClick重置为true,允许再次点击。
3.8.2、这种方式实现简单的节流效果,防止用户过于频繁地切换图片。


JavaScript部分通过简单的事件监听和DOM操作,实现点击缩略图更换大图的交互效果。同时,使用一个简单的节流机制,避免过于频繁的点击操作导致的潜在问题。


vue伪元素

html

<div class="tab_bar">
  <div
    :class="{
      item: true,
      active: item.id === activeTabBar ? true : false
    }"
    v-for="item in tabBarList"
    :key="item.id"
    @click="handleTabBar(item)"
  >
    {{ item.title }}
  </div>
</div>

style

.tab_bar {
  width: 100%;
  display: flex;
  border-bottom: 1px solid #a8a8a8;

  .item {
    position: relative;
    padding: 8px;
    cursor: pointer;
  }

  .item:not(:first-child) {
    margin-left: 8px;
  }

  .active {
    position: relative;
    color: #409eff;
    transition: color 0.5s ease;
  }

  .active::after {
    content: '';
    position: absolute;
    width: 58%;
    height: 3px;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    background-color: #409eff;
  }
}

JavaScript

export default {
  name: 'tabBar',
  data() {
    return {
      activeTabBar: 1,
      tabBarList: [
        { id: 1, title: '正在开班' },
        { id: 2, title: '已结束班级' },
        { id: 3, title: '全部班级' }
      ]
    };
  },
  methods: {
    handleTabBar(row = {}) {
      this.activeTabBar = row.id;
    }
  }
};

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2071211.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

掌握时间的艺术:Python的sched库深度解析

文章目录 掌握时间的艺术&#xff1a;Python的sched库深度解析背景&#xff1a;为何选择sched&#xff1f;什么是sched库&#xff1f;如何安装sched库&#xff1f;简单库函数使用方法1. 创建调度器实例2. 安排事件3. 取消事件4. 运行调度器5. 检查事件是否在队列中 场景应用1. …

iOS profiles文件过期如何更新

创建发布用的Certificates 首先进入到https://developer.apple.com/account页面选择【证书】进入【新建证书】页面 点击【新建证书】按钮&#xff1a; 根据需求选中对应的【证书类型】&#xff0c;我选的是【Apple Distribution】&#xff0c; 开发者证书选择【Apple Devel…

数码管进阶设计验证

前言 随着数字电路和嵌入式系统的广泛应用&#xff0c;数码管作为一种常见的显示设备&#xff0c;在各种电子产品中扮演着重要角色。数码管以其结构简单、显示清晰和成本低廉的特点&#xff0c;广泛应用于计数器、时钟、测量仪器等领域。然而&#xff0c;传统的数码管设计通常仅…

小梅哥 xilinx fpga VGA

module VGA_CTRL(Clk,Reset_n,Data,Data_Req,VGA_HS, //行VGA_VS, //场VGA_BLK, //数据有效的那一段VGA_RGB );input Clk;input Reset_n;input [23:0]Data;output reg Data_Req;output reg VGA_HS;output reg VGA_VS; output reg VGA_BLK;output reg [23:0]VGA_RGB;//{R[7:0]、…

Android常见界面控件(三)

目录 前言 列表控件ListView 常用属性 常用适配器 1.BaseAdapter 2.SimpleAdapter 3.ArrayAdapter 购物商城 选择菜品照片 创建布局文件 实现购物商城列表界面的显示效果 前言 在前面&#xff0c;我们已经讲了六个常用的界面控件和五个界面布局&#xff0c;那么本篇…

【HarmonyOS NEXT星河版开发实战】灯泡定时开关

个人主页→VON 收录专栏→鸿蒙综合案例开发​​​​​ 代码及其图片资源会发布于gitee上面&#xff08;已发布&#xff09; 所有与鸿蒙开发有关的知识点都会在gitee上面进行发布 gitee地址https://gitee.com/wang-xin-jie234 目录 前言 界面功能介绍 界面构建思路 头部 中间…

数据结构——二叉树经典OJ题

1.单值二叉树 单值二叉树&#xff1a;就是判断二叉树里的所有值是否都一样 bool isUnivalTree(struct TreeNode* root) {if(rootNULL)return true;//查找有没有左子树并且看左子树当前指向的值是否和根当前指向的值相等if(root -> left && root -> left -> v…

【三维室内数据集】ScanNet v2使用说明

【版权声明】本文为博主原创文章&#xff0c;未经博主允许严禁转载&#xff0c;我们会定期进行侵权检索。 参考书籍&#xff1a;《人工智能点云处理及深度学习算法》 本文为专栏《Python三维点云实战宝典》系列文章&#xff0c;专栏介绍地址“【python三维深度学习】python…

Python自动化:图片批量添加水印

前言 本文将讲述怎样通过Python自动化的方法&#xff0c;来对照片进行批量的加水印&#xff0c;从而能够有效地阻止他人的非法占有&#xff0c;提高工作的效率。 Python自动化&#xff1a;办公效率的革命 自动化解决方案 实现步骤 读取指定文件夹中的图片&#xff1a;打开…

YOLOv9改进策略【卷积层】| 利用MobileNetv4中的UIB、ExtraDW优化RepNCSPELAN4

一、本文介绍 本文记录的是利用ExtraDW优化YOLOv9中的RepNCSPELAN4&#xff0c;详细说明了优化原因&#xff0c;注意事项等。ExtraDW是MobileNetv4模型中提出的新模块&#xff0c;允许以低成本增加网络深度和感受野&#xff0c;具有ConvNext和IB的组合优势。可以在提高模型精度…

redis | 认识非关系型数据库Redis的哈希数据类型

Redis 非关 kv型 哈希通用命令python 操作hash应用场景 数据类型 数据类型丰富&#xff0c;字符串strings,散列hashes,列表lists&#xff0c;集合sets,有序集合sorted sets等等 哈希 定义 1、由field和关联的value组成的键值对 类似于python的键值对 2、field和value.是字符…

『功能项目』新输入系统【07】

我们打开上一篇06新输入系统项目&#xff0c; 本章要做的事情是摄像机跟随主角移动&#xff0c; 给主角增加一个Player标签方便主摄像机查找主角对象 在编辑场景调好角度&#xff0c;选择Main Camera对象按键盘Ctrl Shift F使运行场景与编辑场景相同 新建CameraCtrl脚本代码 …

秋招突击——8/16——字节广告业务——面经整理——二面挂

文章目录 引言一面面试内容基础知识一、Redis为什么进行AOF重写&#xff1f;二、AQS和Conditon的使用三、乐观锁和分布式锁有什么差异&#xff1f;频繁使用乐观锁行不行&#xff1f;四、Java的即时编译技术五、Java中的JVM调优是如何做的&#xff1f;六、Java中创建对象的流程&…

STM32——BKP备份寄存器RTC实时时钟

首先是理论知识Unix时间戳&#xff1a; 时间戳只显示秒&#xff0c;没有进位&#xff0c;永不进位的秒计数器&#xff0c;60秒就是60秒&#xff0c;100秒就是100秒&#xff0c;它可以和年月日/时分秒进行转换 优点&#xff1a;1、简化硬件电路&#xff08;只需要考虑秒的容量…

C语言 猜数字游戏

目录 1. 随机数⽣成 1.1 rand 1.2 srand 1.3 time 1.4 设置随机数的范围 2. 猜数字游戏实现 游戏要求&#xff1a; 1. 电脑⾃动⽣成1~100的随机数 2. 玩家猜数字&#xff0c;猜数字的过程中&#xff0c;根据猜测数据的⼤⼩给出⼤了或⼩了的反馈&#xff0c;直到猜对&a…

运行微信小程序报错:Bad attr data-event-opts with message

问题 使用uniapp 编译&#xff0c;运行微信小程序环境时&#xff0c;报错 Bad attr data-event-opts with message。&#xff08;这个错误报错原因很多&#xff0c;这里只解决一个&#xff09; 原因 原因是&#xff1a;代码中有&#xff1a; :key"swiperList i"…

猫头虎分享:Python库 Pip 的简介、安装、用法详解入门教程

猫头虎分享&#xff1a;Python库 Pip 的简介、安装、用法详解入门教程 &#x1f3af; 大家好&#xff01;今天猫头虎带您一起探索Python世界中的一个基础工具——Pip。作为一名Python开发者&#xff0c;掌握Pip的使用不仅能帮助你更有效地管理项目中的依赖&#xff0c;还能让你…

【Java】Spring Boot使用 Email 传邮件 (上手图解)

Java系列文章目录 补充内容 Windows通过SSH连接Linux 第一章 Linux基本命令的学习与Linux历史 文章目录 Java系列文章目录一、前言二、学习内容&#xff1a;三、问题描述四、解决方案&#xff1a;4.1 认识依赖4.2 发送邮件步骤4.2.1 先获取授权码4.2.1 邮件配置4.2.2 主体内容…

使用 jar-analyzer 和dbeaver 分析java

https://github.com/jar-analyzer/jar-analyzer 可以进行jar分析&#xff0c;包括method调用 分析完可以通过界面进行一些分析&#xff0c;如果复杂还可以用DbWeaver 打开数据库进行分析

Java SpringBoot+Vue实战教程:如何搭建高中素质评价档案系统?

✍✍计算机编程指导师 ⭐⭐个人介绍&#xff1a;自己非常喜欢研究技术问题&#xff01;专业做Java、Python、微信小程序、安卓、大数据、爬虫、Golang、大屏等实战项目。 ⛽⛽实战项目&#xff1a;有源码或者技术上的问题欢迎在评论区一起讨论交流&#xff01; ⚡⚡ Java实战 |…