vue 翻页组件vue-flip-page效果

2020-12-01 17:04:38

参考地址 vue 翻页组件vue-flip-page效果

虽然不知道vue flip是干啥的,先记录下吧,以后可能会排上大用场哦。


方法
change (改变页面)
tap  (点击)
turning  (正在翻页)
prev  (前一页)
next   (后一页)

翻到指定页面:

1
2
3
4
5
6
7
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;
  },

传入参数:

1
2
3
4
5
6
| 参数 | type | example | describe  |
| ------ | ---- | -------- | ---------- |
| width | number | 375 | 宽度 |
| height | number | 667 | 高度 |
npm包 npm install vue-flip-page

在需要用到的页面中(注意 一个页面目前只能引入一次)

1
2
import turn from "vue-flip-page";
components: { turn }

例子:

效果:

样式:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
.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;
 }

总结

以上所述是小编给大家介绍的vue 翻页组件vue-flip-page效果,希望对大家有所帮助!


  • 2020-06-20 06:31:39

    Android 无线调试手机(WiFi 调试)

    手机需要开启 USB 调试 手机和电脑要在同一个局域网(连接同一个 WiFi) adb connect 连接成功后要拔出 USB 线,不然出现同时连接两个设备的问题 执行命令 ”adb tcpip 6666“ 后可能需要重新开启 USB 调试

  • 2020-08-16 16:09:30

    android WebView 注入js 几种方式

    有时我们开发中需要将js 注入到我们本地,有可能你会说,放在Web不就可以了吗,的确,但是需求就是这样的

  • 2020-11-05 23:20:29

    mac更新node版本

    initializer function 0x0 not in mapped image for /usr/local/bin/node,除了上面的问题 你或许还出现过 no such file or directory 这样的提示,总之更新完以后node直接不能用了。

  • 2020-11-07 16:31:02

    nginx配置X-Frame-Options允许多个域名iframe嵌套

    有时候我们需要允许多个url的来源,但是又不能全部开放,所以应该匹配第三种方法ALLOW-FROM url,那么多个url该如何配置呢,百度了所有网站都没有找到,那么这里写给大家,其实很简单: add_header X-Frame-Options 'ALLOW-FROM https://xxx.xxxxxx.com https://xxx2.xxxxxxx.com'; 就是使用空格隔开就好了!

  • 2020-11-08 08:31:51

    meteor在不同端口启动服务

    当没有任何参数时,run是默认行为,在幕后,它3000端口开启node.js服务器实例,同时开启监听3001端口的MongoDB服务