web建站教程
  1. 首页
  2. vuejs
  3. js
  4. 好玩
  5. AIGC工具
  6. 前端知识
  7. 百度echarts
  8. 更多
    php入门
    nodejs
    mockjs
    reactjs
    mysql
    wordpress
    织梦cms
    帝国cms
    git教程
    IT知识
    模板大全
    休息站
    手机应用

vue商城红包雨抽奖活动代码

484 ℃

Vue移动端抽奖组件,用于vue商城红包雨抽奖场景,可以自定义图片等。下面web建站小编给大家简单介绍一下具体实现代码!

vue组件安装

import { createApp } from "vue";
// vue
import { GiftRain } from "@nutui/nutui-bingo";
// taro
import { GiftRain } from "@nutui/nutui-bingo-taro";

const app = createApp();
app.use(GiftRain);

vue基础用法

<template>
  <nutbig-giftrain
    ref="rain"
    width="100%"
    height="580px"
    @gameOver="gameOver"
    @start="start"
    @click="click"
  >
  </nutbig-giftrain>
  <div v-if="!isStart" class="start" @click="onStart">开始</div>
</template>
<script>
  import { ref } from "vue";
  export default {
    setup() {
      const rain = ref();
      const isStart = ref(false);
      const gameOver = () => {
        isStart.value = false;
      };
      const start = () => {
        isStart.value = true;
      };
      const click = () => {
        console.log("点击");
      };
      const onStart = () => {
        rain.value.startRain();
      };
      return { gameOver, isStart, start, click, onStart, rain };
    },
  };
</script>
<style>
  .nutbig-giftrain .nutbig-giftrain-content {
    background: url("背景图片.png")
      no-repeat;
    background-size: 100% 100%;
    position: relative;
  }
  .start {
    width: 100px;
    height: 30px;
    background: linear-gradient(
      135deg,
      rgba(114, 60, 255, 1) 0%,
      rgba(111, 58, 255, 1) 63.49938195167575%,
      rgba(150, 110, 255, 1) 87.35307751528254%,
      rgba(149, 117, 241, 1) 100%
    );
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: rgba(255, 255, 255, 1);
    position: absolute;
    bottom: 0;
    left: 40%;
  }
</style>

vue年会刮刮卡抽奖活动代码

vue九宫格翻牌抽奖活动代码

vue年会跑马灯抽奖活动代码

vue年会大转盘抽奖活动代码

标签: vue红包雨, 年会抽奖

上面是“vue商城红包雨抽奖活动代码”的全面内容,想了解更多关于 vuejs 内容,请继续关注web建站教程。

当前网址:https://ipkd.cn/webs_14325.html

声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!

当前位置: 网站首页 > vuejs
本文共计1205个字,预计阅读时长9分钟

基金从业资格考试题库

一站式备考基金从业资格考试,收录2021-2025年模拟题库!呱呱工具箱

AI工作站

收录全球3800+ 款各行各业AI应用,轻轻松松做事!
生活小工具,收录了80多款小工具
上一篇: 基于JavaScrip的web动画库——GSAP
下一篇: 免费商用中文字体——优设鲨鱼菲特健康体
x 打工人ai神器