vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果

本篇內(nèi)容介紹了“vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

創(chuàng)新互聯(lián)公司-專業(yè)網(wǎng)站定制、快速模板網(wǎng)站建設(shè)、高性價(jià)比大觀網(wǎng)站開(kāi)發(fā)、企業(yè)建站全套包干低至880元,成熟完善的模板庫(kù),直接使用。一站式大觀網(wǎng)站制作公司更省心,省錢,快速模板網(wǎng)站建設(shè)找我們,業(yè)務(wù)覆蓋大觀地區(qū)。費(fèi)用合理售后完善,10年實(shí)體公司更值得信賴。

1、

vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果

2、

vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果

3、

vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果

//html代碼   測(cè)試 demo命名隨便復(fù)制來(lái)的
<div class="Demo">
        <div class="Before" :class="isTop  ? "contain-Before" : """ @click="handleBefore"></div>
        <div class="After" :class="isTop  ? "contain-After" : """ @click="handleAfter" style="font-size:20px;color:black">這個(gè)是背面內(nèi)容</div>
    </div>

//在data中定義
isTop:false

//methods中的方法
handleBefore(){
  if(!this.isTop){
         this.isTop = true
     }
 },
 handleAfter(){
     if(this.isTop){
         this.isTop = false
     }
 }
//css
.Demo{
    width: 375px;
    height: 300px;
    margin-top: 50px;
    /* margin-left: 500px; */
    position: relative;
    perspective: 800px;
    box-sizing: border-box;
    
    
}
.Before{
    width: 100px;
    height: 200px;
    position: absolute;
    top:0;
    left: 0;
    background-repeat: no-repeat;
    background-position: center center;
    backface-visibility: hidden;
    transition: 1.5s;
    background-image:url("../assets/images/chunfen4.jpg");
    border:1px solid yellow;
 
}
.After{
    width: 100px;
    height: 200px;
    position: absolute;
    top:0;
    left: 0;
    color: #fff;
    background-color:#fff;
    text-indent: 2em;
    transform: rotateY(-180deg);
    backface-visibility: hidden;
    transition: 1.5s;
    border:1px solid yellow;
}
.Demo .contain-Before{
    transform: rotateY(180deg);
}
.Demo .contain-After{
    transform: rotateY(0deg);
}

大功告成,如果想要滑過(guò)翻轉(zhuǎn)的話自行去掉事件,給div添加 :hover 方法

“vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

標(biāo)題名稱:vue怎么實(shí)現(xiàn)點(diǎn)擊翻轉(zhuǎn)效果
標(biāo)題網(wǎng)址:http://bm7419.com/article12/jcicdc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號(hào)、品牌網(wǎng)站建設(shè)、全網(wǎng)營(yíng)銷推廣、ChatGPT、標(biāo)簽優(yōu)化、網(wǎng)站收錄

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站建設(shè)