Skip to content

Hiteggs 组件

介绍

用于砸金蛋抽奖场景,可以自定义金蛋图片等

基础用法

vue
<template>
  <nut-hiteggs></nut-hiteggs>
</template>

自定义传入个数

vue
<template>
  <nut-hiteggs :num="9"></nut-hiteggs>
</template>

砸击事件

vue
<template>
  <nut-hiteggs :num="9" @click="hit"></nut-hiteggs>
</template>
<script setup>
  const hit = () => {
        console.log("中奖啦");
  };
</script>

Props

参数说明类型默认值
num金蛋个数number9
intact-img完整金蛋图片地址string-
hammer锤子图片string-
width金蛋图片宽度string80px
height金蛋图片高度string80px

Events

事件名说明类型
click砸击金蛋后触发() => true

MIT Licensed