当前位置:网站首页>Pop component submission success failure animation
Pop component submission success failure animation
2022-06-13 08:42:00 【huangxunlove】
Realization function
Suppose we want to click... In a component , Then the page jumps to another component , Display the contents of another component .
Implementation method
There are currently two components ,App.vue and popup.vue
The first one is : stay App.vue Introgression popup.vue, Then go straight through ref The way and popup signal communication
The second kind : stay App.vue Add dynamically in :submitData attribute , Back submitData Can be a value of a binding
// adopt this.$refs.pop Can get popup Components , So in App.vue Yeah popup Component values , stay popup.vue in v-if
// The second is through binding attributes , signify popup.vue There are submitData attribute , Still use v-if
<popup ref="pop" :submitData="submitData"></popup>
popup.vue
<template>
<div class="popup">
<div class="success">
// The second method is used here
<div v-if="submitData.valid">
//svg The style of drawing checkmarks
<svg width="120" height="120" viewBox="0 0 40 40">
<circle cx="50%" cy="50%" r="19" class="validCircle"></circle>
<polyline points="5,20 15,30 35 10" class="hookmark" ></polyline>
</svg>
</div>
//svg Cross style
<div v-if="!submitData.valid">
<svg width="120" height="120" viewBox="0 0 40 40">
<circle cx="50%" cy="50%" r="19" class="invalidCircle"></circle>
<line x1="10" y1="10" x2="30" y2="30" class="hookmark"></line>
<line x1="30" y1="10" x2="10" y2="30" class="hookmark"></line>
</svg>
</div>
<div v-if="submitData.valid" class="submit_success"> Submit successfully </div>
<div v-if="!submitData.valid" class="submit_success"> Submit failed </div>
<div v-if="submitData.valid" class="ID_number">ID:{
{ submitData.id }}</div>
<div v-if="!submitData.valid" class="ID_number" style="padding:1.5em .7em;color:var(--gray-dark)">Message:{
{ submitData.message }}</div>
<div class="link">
<a href="#" alt="home" style="padding-right: 6em"> Back to the home page </a>
<a href="#" alt="detail" style="padding-left: 6em"> Check the details </a>
</div>
</div>
</div>
</template>
css Code :
<style scoped> .popup {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
justify-content: center;
background-color: var(--white);
z-index: 9999;
}
.success {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.submit_success {
font-size: 1.2em;
padding-top: 1em;
}
.ID_number {
font-size: 1.5em;
padding: 1.5em 0em;
color: var(--green);
}
.link a {
text-decoration: none;
color: var(--accent);
}
.hookmark {
stroke-dasharray: 100 100;
stroke-dashoffset: 100;
animation: 0.5s linear hookmarkTransform forwards 0.2s;
fill: none;
stroke: var(--white);
stroke-width: 1px;
}
.validCircle {
stroke: var(--green-bright);
stroke-width: 2px;
fill: var(--green-bright);
stroke-dasharray: 320;
}
.invalidCircle {
stroke: var(--red-bright);
stroke-width: 2px;
fill: var(--red-bright);
stroke-dasharray: 320;
}
// Tick animation
@keyframes hookmarkTransform {
from {
stroke-dasharray: 100 100;
stroke-dashoffset: 100;
}
to {
stroke-dasharray: 100 100;
stroke-dashoffset: 0;
}
}
</style>
边栏推荐
- VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案
- 1、 JS introduction
- 0. some doubts about learning SolidWorks for the first time
- Installing pytorch under Anaconda
- Dest0g3 520 orientation
- 【Pycharm踩坑记录】配置远程运行后提示,[Errno 2] No such file or directory
- Mysql_ Preliminary summary of database data (Continued)
- 浅析Visual Studio 使用
- JS - print 99 multiplication table of the for cycle case
- VI editor
猜你喜欢
![WARNING:tornado.access:404 GET /favicon.ico (172.16.8.1) 1.84ms [附静态文件设置]](/img/6d/6eef1f0ebcab45e9a209a3b6c62b03.png)
WARNING:tornado.access:404 GET /favicon.ico (172.16.8.1) 1.84ms [附静态文件设置]

Buuctf web (V)

1.SolidWorks各模块的学习顺序

Phpexcel 10008 error resolution

Penetration problem (main directory, password explosion, database uploading Trojan horse)

array_ Pop error: only variables should be passed by reference

0. some doubts about learning SolidWorks for the first time

JS array using the reduce() method

Microservice system architecture construction I: Environment Construction

CentOS installing MySQL and setting up remote access
随机推荐
JS to get the date in the next seven days of the current date
Format_ String_ Server
PHP isset() method ignores data error handling caused by null parameter value
Buuctf web (VI)
Problems in the deconstruction and assignment of objects, comparison between empty strings and undefined
PHP PNG to webp
8、 JS data type conversion
Taobao commodity sales interface / Taobao commodity sales monitoring interface / cumulative commodity sales interface
Dest0g3 520迎新赛
LVM management exercise
Custom exception class myexception
Bidirectional retransmission step experiment
WARNING:tornado.access:404 GET /favicon.ico (172.16.8.1) 1.84ms [附静态文件设置]
HCIP_ Static experiment
关于RSA加密解密原理
MySQL parsing serialized fields
Yarn package management tool
Tmall product details interface, tmall product coupon interface, tmall API interface, tmall price monitoring interface, tmall price comparison interface, brand rights protection interface, tmall sales
Buuctf web (V)
Vs installation of vassistx plug-in causes Chinese input of wpf-xaml file to be garbled. Solution