国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

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

瀏覽:2日期:2022-09-28 09:56:46

用vue簡單實(shí)現(xiàn)一個點(diǎn)擊翻轉(zhuǎn)的效果,供大家參考,具體內(nèi)容如下

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代碼 測試 demo命名隨便復(fù)制來的<div class='Demo'><div : @click='handleBefore'></div><div : @click='handleAfter' style='font-size:20px;color:black'>這個是背面內(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);}

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

以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Vue
相關(guān)文章:
主站蜘蛛池模板: 沁阳市| 资源县| 奎屯市| 孝感市| 彭水| 新和县| 郸城县| 岢岚县| 仙游县| 安龙县| 固阳县| 邵武市| 衡南县| 凭祥市| 韩城市| 上杭县| 成安县| 婺源县| 罗江县| 泰来县| 南川市| 杭州市| 黔江区| 自治县| 余干县| 西青区| 蒙城县| 喜德县| 三亚市| 大洼县| 和平县| 黔南| 镇巴县| 巴彦县| 海安县| 肇州县| 云龙县| 邢台市| 肇州县| 苍溪县| 平远县|