更新记录
1.0.0(2022-12-28)
下载此版本
无
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
app-vue |
× |
√ |
× |
× |
× |
× |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
× |
× |
× |
× |
× |
× |
× |
× |
× |
vue2
<template>
<view class="content">
<Turntables ref="turntables" @beginBefore="beginBefore" @result="result" />
</view>
</template>
<script>
import Turntables from "@/components/turntables.vue"
export default {
components: {
Turntables
},
onLoad() {
this.$nextTick(() => {
console.log(this.$refs['turntables'])
this.$refs['turntables'].init({
//转盘尺寸
size: 600,
//数据
list: [{
name: 1111,
title: '谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾',
},
{
name: 1111,
title: '湿纸巾',
image: "1.png"
},
{
name: 1111,
title: '湿纸巾',
image: "1.png"
}
],
//转动时间
time: 1
})
})
},
methods: {
beginBefore() {
this.$refs['turntables'].begin()
},
result(e) {
console.log(e)
}
}
}
</script>
vue3
<template>
<Turntable ref="turntable" @beginBefore="beginBefore" @result="result" />
</template>
<script setup>
import Turntable from "@/components/turntables.vue"
import { onLoad } from "@dcloudio/uni-app"
import { getCurrentInstance, nextTick } from "vue"
const { proxy } = getCurrentInstance()
const beginBefore = () => {
proxy.$refs['turntable'].begin()
}
const result = e => {
console.log(e)
}
onLoad(() => {
nextTick(() => {
proxy.$refs['turntable'].init({
//转盘尺寸
size: 600,
//数据
list: [{
name: 1111,
title: '谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾谢谢惠顾',
},
{
name: 1111,
title: '湿纸巾',
image: "1.png"
},
{
name: 1111,
title: '湿纸巾',
image: "1.png"
}
],
//转动时间
time: 1
})
})
})
</script>