Skip to content

Hiteggs 组件

介绍

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

基础用法

html
<template>
  <nut-hiteggs></nut-hiteggs>
</template>

自定义传入个数

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

砸击事件

html
<template>
  <nut-hiteggs :num="9" @click="onHit()"></nut-hiteggs>
</template>
ts
function onHit() {
  console.log("中奖啦");
}

Props

参数说明类型可选值默认值
num金蛋个数number-9
intact-img完整金蛋图片地址string--
hammer锤子图片string--
width金蛋图片宽度string-80px
height金蛋图片高度string-80px

Events

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

MIT Licensed