官方文档
在 Taro 中使用
安装
为了确保相关依赖安装正确, 你必须通过 npm / yarn 来安装
# npm 安装:
npm install @lucky-canvas/taro@latest
# yarn 安装:
yarn add @lucky-canvas/taro@latest
使用
taro-vue 简单示例
<template>
<view>
<!-- 大转盘抽奖 -->
<LuckyWheel width="600rpx" height="600rpx" ...你的配置 />
<!-- 九宫格抽奖 -->
<LuckyGrid width="600rpx" height="600rpx" ...你的配置 />
<!-- 老虎机抽奖 -->
<SlotMachine width="600rpx" height="600rpx" ...你的配置 />
</view>
</template>
<script>
import { LuckyWheel, LuckyGrid, SlotMachine } from '@lucky-canvas/taro/vue'
export default {
components: { LuckyWheel, LuckyGrid, SlotMachine },
}
</script>
taro-react 简单示例
import React from 'react'
import { View } from '@tarojs/components'
import { LuckyWheel, LuckyGrid, SlotMachine } from '@lucky-canvas/taro/react'
export default class Index extends React.Component {
render () {
return <View>
{/* 大转盘抽奖 */}
<LuckyWheel width="300px" height="300px" ...你的配置 />
{/* 大转盘抽奖 */}
<LuckyGrid width="300px" height="300px" ...你的配置 />
{/* 老虎机抽奖 */}
<SlotMachine width="300px" height="300px" ...你的配置 />
</View>
}
}