国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Vue使用Animate.css

這篇具有很好參考價(jià)值的文章主要介紹了Vue使用Animate.css。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

說(shuō)一下Animate.css這個(gè)動(dòng)畫庫(kù),很多的動(dòng)畫在這個(gè)庫(kù)里面都定義好了,我們用的時(shí)候可以直接使用里面的類名就可以了,就是直接目標(biāo)元素綁定對(duì)應(yīng)的類名就可以實(shí)現(xiàn)動(dòng)畫效果,非常方便,庫(kù)其實(shí)也相對(duì)簡(jiǎn)單,使用起來(lái)也簡(jiǎn)單。這里示例就以v3為例了,v2也是一樣的

github:https://github.com/animate-css/animate.css?

官網(wǎng):https://animate.style/?

首先安裝

pnpm add animate.css

引入?

main.js?

import 'animate.css'

使用

接下來(lái)就可以正常使用了?

注意:在添加類名的時(shí)候,里面所有的動(dòng)畫必須先設(shè)置上 animate__animated ,然后再設(shè)置對(duì)應(yīng)動(dòng)畫的類名,否則是不會(huì)生效的,大家簡(jiǎn)單看一下源碼就能了解

下面是個(gè)示例:?

Vue使用Animate.css,前端,vue3,css,vue.js,css,前端?

接下來(lái)代碼:?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-675870.html

<template>
  <div class="main">
    <label for=""><span style="fontSize: 13px;margin-right: 5px;">開啟無(wú)限輪詢</span></label>
    <input v-model="isInfinite" type="checkbox">
    <div class="animates-container">
      <button v-for="animateName in animateNames1" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames2" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames3" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames4" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames5" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames6" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames7" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames8" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames9" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    <div class="animates-container">
      <button v-for="animateName in animateNames10" :key="animateName" @click="setAnimate(animateName)">{{ animateName }}</button>
    </div>
    
    <div class="testAnimate" :class="[`${animationsClass()}`, { 'animate__infinite': isInfinite }]"></div>
  </div>
</template>
<script setup>
import { ref } from 'vue'
let animateNames1 = [
  'bounce',
  'flash',
  'pulse',
  'rubberBand',
  'shakeX',
  'shakeY',
  'headShake',
  'swing',
  'tada',
  'wobble',
  'jello',
  'heartBeat',
]
let animateNames2 = [
  'backInDown',
  'backInLeft',
  'backInRight',
  'backInUp',
  'backOutDown',
  'backOutLeft',
  'backOutRight',
  'backOutUp'
]
let animateNames3 = [
  'bounceIn',
  'bounceInDown',
  'bounceInLeft',
  'bounceInRight',
  'bounceInUp',
  'bounceOut',
  'bounceOutDown',
  'bounceOutLeft',
  'bounceOutRight',
  'bounceOutUp',
]
let animateNames4 = [
  'fadeIn',
  'fadeInDown',
  'fadeInDownBig',
  'fadeInLeft',
  'fadeInLeftBig',
  'fadeInRight',
  'fadeInRightBig',
  'fadeInUp',
  'fadeInUpBig',
  'fadeInTopLeft',
  'fadeInTopRight',
  'fadeInBottomLeft',
  'fadeInBottomRight',
  'fadeOut',
  'fadeOutDown',
  'fadeOutDownBig',
  'fadeOutLeft',
  'fadeOutLeftBig',
  'fadeOutRight',
  'fadeOutRightBig',
  'fadeOutUp',
  'fadeOutUpBig',
  'fadeOutTopLeft',
  'fadeOutTopRight',
  'fadeOutBottomRight',
  'fadeOutBottomLeft'
]
let animateNames5 = ref([
  'flip',
  'flipInX',
  'flipInY',
  'flipOutX',
  'flipOutY'
])
let animateNames6 = ref([
  'lightSpeedInRight',
  'lightSpeedInLeft',
  'lightSpeedOutRight',
  'lightSpeedOutLeft'
])
let animateNames7 = ref([
  'rotateIn',
  'rotateInDownLeft',
  'rotateInDownRight',
  'rotateInUpLeft',
  'rotateInUpRight',
  'rotateOut',
  'rotateOutDownLeft',
  'rotateOutDownRight',
  'rotateOutUpLeft',
  'rotateOutUpRight'
])
let animateNames8 = ref([
  'hinge',
  'jackInTheBox',
  'rollIn',
  'rollOut'
])
let animateNames9 = ref([
  'zoomIn',
  'zoomInDown',
  'zoomInLeft',
  'zoomInRight',
  'zoomInUp',
  'zoomOut',
  'zoomOutDown',
  'zoomOutLeft',
  'zoomOutRight',
  'zoomOutUp'
])
let animateNames10 = ref([
  'slideInDown',
  'slideInLeft',
  'slideInRight',
  'slideInUp',
  'slideOutDown',
  'slideOutLeft',
  'slideOutRight',
  'slideOutUp'
])

let animates = ref([])
let isInfinite = ref(false)

const setAnimate = animateName => {
  animates.value.shift()
  animates.value.push(animateName)
}

const animationsClass = () => {
  if (animates.value.length) {
    return `animate__animated animate__${animates.value[0]}`
  }
  return ''
}
</script>
<style scoped>
.main {
  width: 100%;
  height: 100%;
  padding: 40px 0 0 50px;
  box-sizing: border-box;
  overflow: hidden;
}
.main button {
  margin-right: 8px;
  cursor: pointer;
}

.animates-container {
  margin: 20px 0;
}

.main .testAnimate {
  width: 300px;
  height: 300px;
  background-color: red;
  margin: 50px 0 0 10px;
  padding: 30px;
  box-sizing: border-box;
}
</style>

到了這里,關(guān)于Vue使用Animate.css的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 前端技術(shù)Html,Css,JavaScript,Vue3

    1.基本標(biāo)簽 2.文本格式化 3.鏈接 4.圖片 5.無(wú)序列表 6.有序列表 7.表格 8.表單 1.選擇器 2.文本和字體 3.鏈接 4.隱藏 5.定位position 6.浮動(dòng) 7.對(duì)齊 8.圖像 1.輸出 2.函數(shù) 3.常用事件 4.DOM 5.改變Html 6.DOM 元素 (節(jié)點(diǎn)) 尾部創(chuàng)建新的 HTML 元素 (節(jié)點(diǎn)) - appendChild() 頭部創(chuàng)建新的 HTML 元素 (節(jié)點(diǎn))

    2024年02月13日
    瀏覽(53)
  • 前端(四)——vue.js、vue、vue2、vue3

    前端(四)——vue.js、vue、vue2、vue3

    ??博主:小貓娃來(lái)啦 ??文章核心: vue.js、vue、vue2、vue3從全局到局部 Vue.js是一款流行的JavaScript框架 vue,vue2,vue3都是vue.js的不同版本。 Vue:Vue.js的第一個(gè)版本,也稱為Vue 1.x。它于2014年首次發(fā)布,并獲得了廣泛的應(yīng)用和認(rèn)可。 Vue2:Vue.js的第二個(gè)版本,也稱為Vue 2.x。它在Vu

    2024年02月12日
    瀏覽(28)
  • 使用CSS3 + Vue3 + js-tool-big-box工具,實(shí)現(xiàn)炫酷五一倒計(jì)時(shí)動(dòng)效

    使用CSS3 + Vue3 + js-tool-big-box工具,實(shí)現(xiàn)炫酷五一倒計(jì)時(shí)動(dòng)效

    時(shí)間過(guò)得真是飛速,很快又要到一年一度的五一勞動(dòng)節(jié)啦,今年五天假,做好準(zhǔn)備了嗎?今天我們用 CSS3 + Vue3 + 一個(gè)前端工具庫(kù) js-tool-big-box 來(lái)實(shí)現(xiàn)一個(gè)炫酷的五一倒計(jì)時(shí)動(dòng)效吧。 目錄 1??先制作一個(gè)CSS3樣式 2 Vue3功能提前準(zhǔn)備? 3 使用js-tool-big-box工具完成倒計(jì)時(shí) 3.1 安裝工具

    2024年04月25日
    瀏覽(25)
  • Vue3通過(guò)JS修改Css樣式(附節(jié)點(diǎn)獲取相關(guān)知識(shí))

    方法一:通過(guò)獲取節(jié)點(diǎn)style(獲取標(biāo)簽節(jié)點(diǎn)) 方法二:通過(guò)動(dòng)態(tài)設(shè)置class 方法三:直接動(dòng)態(tài)設(shè)置style ?附節(jié)點(diǎn)獲取相關(guān)知識(shí)

    2024年02月16日
    瀏覽(25)
  • vue3 + Tailwind Css + Vite 搭建快速開發(fā)前端樣式環(huán)境

    vue3 + Tailwind Css + Vite 搭建快速開發(fā)前端樣式環(huán)境

    一個(gè)功能類優(yōu)先的 CSS 框架,用于快速構(gòu)建定制的用戶界面。這是來(lái)自 TailwindCss 官方定義。 中文網(wǎng)站 Tailwindcss 基于原子化理念,將樣式重復(fù)性代碼降到最小,原本開發(fā)最大限度基于類名的聲明塊不重復(fù),現(xiàn)在Tailwindcss基于單獨(dú)一句聲明不重復(fù)。 活躍度 github starts 數(shù)量達(dá)到

    2024年02月04日
    瀏覽(29)
  • 前端筆記(Css、JS、Vue、UniApp、微信小程序)

    點(diǎn)擊穿透 應(yīng)用場(chǎng)景:點(diǎn)贊或送禮等出現(xiàn)的彈窗遮罩,無(wú)法再次觸發(fā)點(diǎn)擊事件 磨砂模糊 底部安全距離 可以放入【common.scss】中,在需要的頁(yè)面引入 寬度根據(jù)內(nèi)容決定 媒體查詢@media 必須是以 @media 開頭 使用 mediatype 指定媒體(設(shè)備)類型 使用 and | not | only 邏輯操作符構(gòu)建復(fù)雜

    2024年04月26日
    瀏覽(71)
  • 【前端vue升級(jí)】vue2+js+elementUI升級(jí)為vue3+ts+elementUI plus

    【前端vue升級(jí)】vue2+js+elementUI升級(jí)為vue3+ts+elementUI plus

    gogo code 是一個(gè)基于 AST (源代碼的抽象語(yǔ)法結(jié)構(gòu)樹狀表現(xiàn)形式)的 JavaScript/Typescript/HTML 代碼轉(zhuǎn)換工具,可以用它來(lái)構(gòu)建一個(gè)代碼轉(zhuǎn)換程序來(lái)幫助自動(dòng)化完成如框架升級(jí)、代碼重構(gòu)、多平臺(tái)轉(zhuǎn)換等工作。 當(dāng)前 GoGoCode 支持解析和操作如下類型的代碼: ○JavaScript(JSX) ○Typescript

    2024年02月12日
    瀏覽(31)
  • 【vue3】js + css 實(shí)現(xiàn) 視頻框選放大:局部細(xì)節(jié)放大、放大鏡效果

    【vue3】js + css 實(shí)現(xiàn) 視頻框選放大:局部細(xì)節(jié)放大、放大鏡效果

    實(shí)現(xiàn)鼠標(biāo)框選區(qū)域放大顯示。 需求1:放大 按住鼠標(biāo)左鍵不放 ——》向右側(cè)拖動(dòng),框選出需要放大的區(qū)域后 ——》松開鼠標(biāo) ——》框選區(qū)域放大顯示 需求2:還原 按住鼠標(biāo)左鍵不放 ——》向左側(cè)拖動(dòng),框選出隨意大小的區(qū)域后 ——》松開鼠標(biāo) ——》視圖顯示大小還原 需求

    2024年02月03日
    瀏覽(29)
  • 前端2023最全面試題(javaScript、typeScript、vue2、vue3、html、css、uniapp、webpack、vite、react)

    答案:JavaScript中的閉包是一種函數(shù),它有權(quán)訪問(wèn)其詞法環(huán)境的變量和其它函數(shù)。這意味著,即使其包含它的函數(shù)已經(jīng)執(zhí)行完畢,其詞法環(huán)境仍然存在,因此可以訪問(wèn)其作用域內(nèi)的變量。 答案:回調(diào)函數(shù)是在某個(gè)特定事件之后執(zhí)行的函數(shù)。在JavaScript中,通常使用回調(diào)函數(shù)來(lái)處

    2024年02月06日
    瀏覽(35)
  • vue-codemirror實(shí)現(xiàn)一個(gè)前端代碼在線編輯器,可處理 HTML,VUE,JS,CSS代碼在線編輯

    vue-codemirror實(shí)現(xiàn)一個(gè)前端代碼在線編輯器,可處理 HTML,VUE,JS,CSS代碼在線編輯

    先找個(gè)目錄創(chuàng)建一個(gè)vue項(xiàng)目 例如 我們想要項(xiàng)目叫 editor 在終端執(zhí)行 2和3其實(shí)都可以 但個(gè)人建議 最近還是2會(huì)更穩(wěn)定一些 在終端執(zhí)行 引入依賴包 然后在項(xiàng)目src目錄下創(chuàng)建 utils 文件夾 里面創(chuàng)建一個(gè)setting.js 參考代碼如下 然后 這邊 調(diào)用組件的代碼 因?yàn)轫?xiàng)目也剛創(chuàng) 我直接寫 s

    2024年02月15日
    瀏覽(32)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包