網站首頁 編程語言 正文
提示:繼el-tab 切換時添加動畫_CMDN哈哈哈哈哈的博客-CSDN博客之后。
目錄
1. 需求:
2.?解決方法:
1.?先寫動畫樣式
?2.? 設類名
?3.?在data?里面定義inAnimation?
?4.?在methods?寫方法
1. 需求:
點擊按鈕,在跳轉路由之前,先觸發動畫,動畫完成之后移除樣式
2.?解決方法:
1.?先寫動畫樣式
? ?之所以吧anim和gzindex寫在一起,是為了切換動畫時頁面有樣式。
//頁面一進來加載
.GZindex,.Anim {
animation: zoomIn 1.5s 0.02s ease backwards;
background: url("../../assets/imgList/GZIndexBG.jpg") no-repeat;
height: 100%;
background-position: center;
width: 100%;
background-size: 100% 100%;
position: fixed;
}
//觸發事件后加載
.Anim {
animation: zoomOut 1.5s 0.02s ease backwards;
/* animate__zoomOut */
}
?2.? 設類名
gzindex :頁面樣式
anim:?動畫?
想法:通過判斷inAnimation來決定是觸發哪個類
?3.?在data?里面定義inAnimation?
export default {
name: 'GZIndex',
data () {
return {
inAnimation:true
}
}
}
?4.?在methods?寫方法
在需要觸發動畫的事件中給inAnimation賦值即可
(點擊按鈕,調用方法,在方法里給inAnimation?賦值)
原文鏈接:https://blog.csdn.net/CMDN123456/article/details/130337710
- 上一篇:沒有了
- 下一篇:沒有了
相關推薦
- 2022-05-23 .NET異步編程模式的三種類型介紹_實用技巧
- 2023-01-02 使用Flutter?構建Web應用邏輯解析_Android
- 2022-04-20 C語言進階輸入輸出重定向與fopen函數使用示例詳解_C 語言
- 2022-06-22 React?數據共享useContext的實現_React
- 2022-10-06 SQL語句中的ON?DUPLICATE?KEY?UPDATE使用_MsSql
- 2022-10-15 Go?Excelize?API源碼閱讀GetPageLayout及SetPageMargins_Go
- 2022-03-19 Linux系統下安裝Redis數據庫過程_Redis
- 2022-08-10 pandas溫差查詢案例的實現_python
- 欄目分類
-
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支