vue 翻页组件vue-flip-page

方法
change (改变页面)
tap  (点击)
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;
    },
 
传入参数:
 
| 参数  | 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", }
 ] | 传入的数据 |
npm包  npm install vue-flip-page

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

import turn from "vue-flip-page";
     <turn
            :width="turnwidth"
            :height="turnheight"
            ref="turn"
            @change="changeCurrent"
            :data="recentlsit"
          ></turn>
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;
  }

转载:https://blog.csdn.net/qq_38188485/article/details/104169249


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    .oul {
        width: 100px;
        height: 200px;
        border: 1px solid #000;
        margin: 100px auto;
        transform-style: preserve-3d;
        transform: rotateX(60deg);


    }

    .oli {
        width: 100%;
        height: 100%;
        list-style-type: none;
        transition: all 2s linear;
        transform: rotateY(0deg);
    

        transform-origin: 0 40%;
    }

    .oul:hover .oli {
        background-color: #f00;
        transform: rotateY(-160deg);
  
    }
</style>

<body>
    <ul class="oul">
        <li class="oli"></li>
    </ul>
    <script>

    </script>
</body>

</html>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
`vue-beautiful-chat`是一个基于Vue2的聊天组件,支持实时聊天、多人聊天、消息记录等功能,使用起来非常方便。下面是使用`vue-beautiful-chat`的步骤: 1. 安装`vue-beautiful-chat` 可以使用npm命令进行安装:`npm install vue-beautiful-chat` 2. 引入并使用组件Vue组件中引入`vue-beautiful-chat`组件,并在`template`中使用: ```html <template> <div> <h1>聊天室</h1> <vue-beautiful-chat :messages="messages" @message="handleMessage" /> </div> </template> <script> import VueBeautifulChat from "vue-beautiful-chat"; export default { components: { VueBeautifulChat, }, data() { return { messages: [], }; }, methods: { handleMessage(message) { // 处理接收到的消息 console.log("Received message:", message); }, }, }; </script> ``` 在上面的代码中,`vue-beautiful-chat`组件的属性`messages`用来绑定消息数组,`@message`事件用来处理接收到的消息。 3. 发送消息 可以使用`vue-beautiful-chat`组件提供的`sendMessage`方法发送消息: ```javascript this.$refs.chat.sendMessage({ type: "text", content: "Hello, world!", sender: { name: "John Doe", avatar: "https://randomuser.me/api/portraits/men/1.jpg", }, }); ``` 其中,`type`表示消息类型(可以是文本、图片、音频等),`content`表示消息内容,`sender`表示消息发送者的信息。 4. 消息记录 `vue-beautiful-chat`组件提供了`loadMessages`方法用来加载历史消息记录: ```javascript this.$refs.chat.loadMessages([ { type: "text", content: "Hello, world!", sender: { name: "John Doe", avatar: "https://randomuser.me/api/portraits/men/1.jpg", }, }, // ... ]); ``` 以上是使用`vue-beautiful-chat`的基本步骤,具体的功能和使用方法可以参考`vue-beautiful-chat`的官方文档。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

web修理工

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值