vue 翻頁組件vue-flip-page效果
方法
change (改變頁面)
tap (點(diǎn)擊)
turning (正在翻頁)
prev (前一頁)
next (后一頁)
翻到指定頁面:
handleSwitchManual(index) {
if (index === this.currentIndex) return;
this.$refs["turn"].toPage(index);
this.currentIndex = index;
this.goods_id = this.manuals[this.currentIndex].goods_id;
this.show = false;
},
傳入?yún)?shù):
| 參數(shù) | type | example | describe |
| ------ | ---- | -------- | ---------- |
| width | number | 375 | 寬度 |
| height | number | 667 | 高度 |
| data | Array | [ { "picture_image": "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2600216442,2384386498&fm=15&gp=0.jpg", }, { "picture_image": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1580807703833&di=0ab054549c3ea050dc0bd49e146b20e9&imgtype=0&src=http%3A%2F%2Fwww.thatsmags.com%2Fimage%2Fview%2F201703%2Fvue-cover.jpg", }] | 傳入的數(shù)據(jù) |
npm包 npm install vue-flip-page
在需要用到的頁面中(注意 一個頁面目前只能引入一次)
import turn from "vue-flip-page";
components: { turn }
例子:
效果:

樣式:
.manual-wrap {
position: relative;
z-index: 0;
width: 100%;
height: 100%;
opacity: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-transform: scale(0.95);
transform: scale(0.95);
-webkit-transition: opacity ease 0.5s;
transition: opacity ease 0.5s;
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
user-select: none;
-o-user-select: none;
}
.manual-wrap.active {
-webkit-transform: scale(1);
transform: scale(1);
opacity: 1;
}
總結(jié)
以上所述是小編給大家介紹的vue 翻頁組件vue-flip-page效果,希望對大家有所幫助!
相關(guān)文章
vue安裝和使用scss及sass與scss的區(qū)別詳解
這篇文章主要介紹了vue安裝和使用教程,用了很久css預(yù)編譯器,但是一直不太清楚到底用的sass還是scss,直到有天被問住了有點(diǎn)尷尬,感興趣的朋友一起看看吧2018-10-10
ElementUI中el-form組件的rules參數(shù)舉例詳解
Form組件提供了表單驗(yàn)證的功能,只需要通過rules屬性傳入約定的驗(yàn)證規(guī)則,并將Form-Item的prop屬性設(shè)置為需校驗(yàn)的字段名即可,下面這篇文章主要給大家介紹了關(guān)于ElementUI中el-form組件的rules參數(shù)的相關(guān)資料,需要的朋友可以參考下2023-10-10
vue-cli項(xiàng)目使用mock數(shù)據(jù)的方法(借助express)
現(xiàn)如今前后端分離開發(fā)越來越普遍,前端人員寫好頁面后可以自己模擬一些數(shù)據(jù)進(jìn)行代碼測試,這樣就不必等后端接口,提高了我們開發(fā)效率。今天就來分析下前端常用的mock數(shù)據(jù)的方式是如何實(shí)現(xiàn)的,需要的朋友可以參考下2019-04-04
Vue3中ref和reactive的基本使用及區(qū)別詳析
這篇文章主要給大家介紹了關(guān)于Vue3中ref和reactive的基本使用及區(qū)別的相關(guān)資料,需要的朋友可以參考下2022-07-07
解決electron打包vue-element-admin項(xiàng)目頁面無法跳轉(zhuǎn)的問題小結(jié)
這篇文章主要介紹了解決electron打包vue-element-admin項(xiàng)目頁面無法跳轉(zhuǎn)的問題小結(jié),本文通過實(shí)例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友參考下吧2024-03-03

