【技术实战】Vue技术实战【五】
需求实战一
效果展示

代码展示
<template>
<div class="home-component">
<div class="progress-container">
<a-progress type="circle" :percent="number" />
</div>
<ARow>
<div class="button-container">
<a-button type="primary" @click="addNumber">增加数值</a-button>
</div>
 
 
 
<div class="button-container">
<a-button type="primary" @click="minNumber">减少数值</a-button>
</div>
</ARow>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const number = ref(80);
const addNumber = () => {
number.value = number.value + 10;
};
const minNumber = () => {
number.value = number.value - 10;
};
</script>
<style scoped>
.home-component {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.progress-container {
padding: 30px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
.button-container {
padding: 30px 0;
}
.button-container a-button {
color: #fff;
border: none;
animation: bounce 1s infinite;
}
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
/* Additional Effects and Styles */
.progress-container {
background-color: #f2f2f2;
border-radius: 50%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}
.button-container {
display: flex;
justify-content: center;
}
.button-container a-button {
padding: 10px 20px;
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
</style>
代码解读
需求实战二
效果展示

代码展示
<template>
<div class="home-component">
<div class="progress-container">
<a-progress type="circle" :percent="number" />
</div>
<ARow>
<ACol span="10">
<div class="button-container">
<a-button class="increase-button" type="primary" @click="addNumber">增加数值</a-button>
</div>
</ACol>
<ACol span="4">
</ACol>
<ACol span="10">
<div class="button-container">
<a-button class="decrease-button" type="primary" @click="minNumber">减少数值</a-button>
</div>
</ACol>
</ARow>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const number = ref(80);
const addNumber = () => {
number.value = number.value + 10;
};
const minNumber = () => {
number.value = number.value - 10;
};
</script>
<style scoped>
.home-component {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.progress-container {
padding: 30px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.2);
}
100% {
transform: scale(1);
}
}
.button-container {
padding: 30px 0;
}
@keyframes bounce {
0%,
100% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
}
/* Additional Effects and Styles */
.progress-container {
background-color: #f2f2f2;
border-radius: 50%;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
animation: pulse 2s infinite, bounce 2s infinite;
}
.button-container {
display: flex;
justify-content: center;
}
.increase-button {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s, transform 0.3s;
animation: bounce 2s infinite;
}
.increase-button:hover {
background-color: #38b2ac;
transform: scale(1.1);
}
.decrease-button {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
transition: background-color 0.3s, transform 0.3s;
animation: bounce 2s infinite;
}
.decrease-button:hover {
background-color: #eb5766;
transform: scale(1.1);
}
</style>
代码解读
需求实战三
效果展示

代码展示
<template>
<div class="home-component">
<div class="progress-container">
<a-progress type="circle" :percent="number" strokeColor="#38b2ac" strokeWidth="10"/>
</div>
<ARow>
<ACol span="10">
<div class="button-container">
<a-button class="increase-button" type="primary" @click="addNumber">增加数值</a-button>
</div>
</ACol>
<ACol span="4">
</ACol>
<ACol span="10">
<div class="button-container">
<a-button class="decrease-button" type="primary" @click="minNumber">减少数值</a-button>
</div>
</ACol>
</ARow>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const number = ref(80);
const addNumber = () => {
number.value = (number.value + 10) % 100;
};
const minNumber = () => {
number.value = (number.value - 10 > 0) ? (number.value - 10) : 0;
};
</script>
<style scoped>
.home-component {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.progress-container {
position: relative;
padding: 30px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
.button-container {
display: flex;
justify-content: center;
padding: 30px 0;
animation: bounce 2s infinite;
animation-delay: 1s;
}
.increase-button,
.decrease-button {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
border: none;
transition: all 0.3s;
border-radius: 5px;
}
.increase-button {
background-color: #38b2ac;
margin-right: 10px;
}
.decrease-button {
background-color: #eb5766;
margin-left: 10px;
}
.increase-button:hover,
.decrease-button:hover {
transform: scale(1.05);
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
}
</style>
代码解释
需求实战四
效果展示

代码展示
<template>
<div class="home-component">
<div class="progress-container">
<a-progress type="circle" :percent="number" :strokeColor="progressColor" strokeWidth="10"/>
</div>
<ARow>
<ACol span="10">
<div class="button-container">
<a-button class="increase-button" type="primary" @click="addNumber">增加数值</a-button>
</div>
</ACol>
<ACol span="4"></ACol>
<ACol span="10">
<div class="button-container">
<a-button class="decrease-button" type="primary" @click="minNumber">减少数值</a-button>
</div>
</ACol>
</ARow>
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
const number = ref(80);
const addNumber = () => {
number.value = (number.value + 10) % 100;
};
const minNumber = () => {
number.value = number.value - 10 > 0 ? number.value - 10 : 0;
};
const progressColor = computed(() => {
return number.value > 50 ? '#38b2ac' : '#eb5766';
});
</script>
<style scoped>
.home-component {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.progress-container {
position: relative;
padding: 30px;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% {
transform: scale(1);
}
50% {
transform: scale(1.05);
}
100% {
transform: scale(1);
}
}
.button-container {
display: flex;
justify-content: center;
padding: 30px 0;
animation: bounce 2s infinite;
animation-delay: 1s;
}
.increase-button,
.decrease-button {
font-size: 16px;
font-weight: bold;
text-transform: uppercase;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
border: none;
transform: scale(1.05) rotate(360deg);
transition: transform 1s;
border-radius: 5px;
}
.increase-button {
background-color: #38b2ac;
margin-right: 10px;
}
.decrease-button {
background-color: #eb5766;
margin-left: 10px;
}
.increase-button:hover,
.decrease-button:hover {
transform: scale(1.05);
box-shadow: 0 2px 15px rgba(0, 0, 0, 0.4);
}
.progress-container {
background-image: -webkit-linear-gradient(left, #38b2ac, #eb5766);
}
</style>
代码解读
【技术实战】Vue技术实战【五】的更多相关文章
- Vue应用框架整合与实战--Vue技术生态圈篇
实用框架以及工具 UI组件 开发框架 实用库 服务端 辅助工具 应用实例 Demo示例 UI组件 Element-UI ★13489 - 饿了么出品的Vue2的web UI工具套件 Vux ★8133 ...
- 快读《ASP.NET Core技术内幕与项目实战》EFCore2.5:集合查询原理揭秘(IQueryable和IEnumerable)
本节内容,涉及4.6(P116-P130).主要NuGet包:如前述章节 一.LINQ和EFCore的集合查询扩展方法的区别 1.LINQ和EFCore中的集合查询扩展方法,虽然命名和使用完全一样,都 ...
- 《ASP.NET Core技术内幕与项目实战》精简集-目录
本系列是杨中科2022年最新作品<ASP.NET Core技术内幕与项目实战>及B站配套视频(强插点赞)的精简集,是一个读书笔记.总结和提炼了主要知识点,遵守代码优先原则,以利于快速复习和 ...
- 躬身入局,干货分享,2023年春招后端技术岗(Python)面试实战教程,Offer今始为君发
早春二月,研发倍忙,杂花生树,群鸥竟飞.为什么?因为春季招聘,无论是应届生,还是职场老鸟,都在摩拳擦掌,秣马厉兵,准备在面试场上一较身手,既分高下,也决Offer,本次我们打响春招第一炮,躬身入局,让 ...
- 深度解析SDN——利益、战略、技术、实践(实战派专家力作,业内众多专家推荐)
深度解析SDN——利益.战略.技术.实践(实战派专家力作,业内众多专家推荐) 张卫峰 编 ISBN 978-7-121-21821-7 2013年11月出版 定价:59.00元 232页 16开 ...
- 基于TC技术的网络流量控制实战
本文转载在:http://server.it168.com/a2010/0426/878/000000878406.shtml 基于TC技术的网络流量控制实战 650) this.width=650; ...
- 超级干货:动态防御WAF技术原理及编程实战!
本文带给大家的内容是动态防御WAF的技术原理及编程实战. 将通过介绍ShareWAF的核心技术点,向大家展示动态防御的优势.实现思路,并以编程实战的方式向大家展示如何在WAF产品开发过程中应用动态防御 ...
- 简读《ASP.NET Core技术内幕与项目实战》之3:配置
特别说明:1.本系列内容主要基于杨中科老师的书籍<ASP.NET Core技术内幕与项目实战>及配套的B站视频视频教程,同时会增加极少部分的小知识点2.本系列教程主要目的是提炼知识点,追求 ...
- 快读《ASP.NET Core技术内幕与项目实战》WebApi3.1:WebApi最佳实践
本节内容,涉及到6.1-6.6(P155-182),以WebApi说明为主.主要NuGet包:无 一.创建WebApi的最佳实践,综合了RPC和Restful两种风格的特点 1 //定义Person类 ...
- 从开发一款基于Vue技术栈的全栈热重载生产环境脚手架,我学到了什么
浏览文章前 这一期,我分享给大家三点看源码的小技巧,这也是从别的大佬那总结的. 被反复使用的代码 这样的代码是一个软件的重点函数,一个大神的写法有很多精华值得学习. 穿越时间的代码 如果一段代码10年 ...
随机推荐
- linux下防火墙与SELinux状态与关闭
linux下防火墙与SELinux状态与关闭 在使用ftp命令以及wget命令测试两台linux机器之间ftp下载是否正常,虽然关闭了防火墙,但是一直还是提示以下错误 然来还需要将SELinux 设置 ...
- [Tensorflow]模型持久化的原理,将CKPT转为pb文件,使用pb模型预测
文章目录 [Tensorflow]模型持久化的原理,将CKPT转为pb文件,使用pb模型预测 一.模型持久化 1.持久化代码实现 convert_variables_to_constants固化模型结 ...
- 解密Elasticsearch:深入探究这款搜索和分析引擎
作者:京东保险 管顺利 开篇 最近使用Elasticsearch实现画像系统,实现的dmp的数据中台能力.同时调研了竞品的架构选型.以及重温了redis原理等.特此做一次es的总结和回顾.网上没看到有 ...
- List 集合手动分页的方法总结
前言 在工作中难免会遇到,将组装的集合数据进行分页处理,现在我将自己手动分页的三种方法进行总结,有不对的地方敬请大家批评指正! 一.数据准备 // 当前页 int pageIndex = 1; // ...
- 2021-10-20:分数到小数。给定两个整数,分别表示分数的分子numerator和分母denominator,以字符串形式返回小数。如果小数部分为循环小数,则将循环的部分括在括号内。输入: num
2021-10-20:分数到小数.给定两个整数,分别表示分数的分子numerator和分母denominator,以字符串形式返回小数.如果小数部分为循环小数,则将循环的部分括在括号内.输入: num ...
- Vue入门浅析
title: vue入门浅析 author: Sun-Wind date: May 14,2022 写这篇博文的目的在于为初学vue的同学对vue有一些更进一步的了解 读这篇博文前,您应该至少安装了v ...
- Vue 路由router
简单案例: App.vue是核心组件,其中的<router-link>相当于a标签,to相当于href,export是暴露函数,这样某组件才能被其他组件识别到 代码: <templa ...
- 2022年第十四届四川省大学生程序设计大赛 A
A Adjacent Swapping 题意: 给定一个字符串,每次可以移动相邻字符,求最小移动次数可以把它变成s+s这样左右两边相同的字符串. 思路: 1:我们知道他一定是偶数长度,所以我们把字符串 ...
- 详解RocketMQ 顺序消费机制
摘要:顺序消息是指对于一个指定的 Topic ,消息严格按照先进先出(FIFO)的原则进行消息发布和消费,即先发布的消息先消费,后发布的消息后消费. 本文分享自华为云社区<RocketMQ 顺序 ...
- jvm中类和对象定义存储基础知识
1 类文件数据结构类型 Class文件结构主要有两种数据结构:无符号数和表 •无符号数:用来表述数字,索引引用.数量值以及字符串等,比如 图1中类型为u1,u2,u4,u8分别代表1个字节,2个字节, ...