Administrator 1 month ago
parent
commit
f2a2fc5f13
  1. 7
      package-lock.json
  2. 4
      package.json
  3. 18
      src/views/DZP.vue
  4. 5
      vite.config.js

7
package-lock.json

@ -14,7 +14,7 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.2.0"
"vite": "^6.2.6"
}
},
"node_modules/@babel/helper-string-parser": {
@ -1150,10 +1150,9 @@
},
"node_modules/vite": {
"version": "6.2.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vite/-/vite-6.2.6.tgz",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.6.tgz",
"integrity": "sha512-9xpjNl3kR4rVDZgPNdTL0/c6ao4km69a/2ihNQbcANz8RuCOK3hQBmLSJf3bRKVQjVMda+YvizNE8AwvogcPbw==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.25.0",
"postcss": "^8.5.3",
@ -1860,7 +1859,7 @@
},
"vite": {
"version": "6.2.6",
"resolved": "https://mirrors.huaweicloud.com/repository/npm/vite/-/vite-6.2.6.tgz",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.2.6.tgz",
"integrity": "sha512-9xpjNl3kR4rVDZgPNdTL0/c6ao4km69a/2ihNQbcANz8RuCOK3hQBmLSJf3bRKVQjVMda+YvizNE8AwvogcPbw==",
"dev": true,
"requires": {

4
package.json

@ -4,7 +4,7 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"dev": "vite --host",
"build": "vite build",
"preview": "vite preview"
},
@ -15,6 +15,6 @@
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.2.1",
"vite": "^6.2.0"
"vite": "^6.2.6"
}
}

18
src/views/DZP.vue

@ -6,12 +6,14 @@ const myLucky = ref()
const wheelConfig = ref({
})
const prizes = ref([
{ fonts: [{ text: '0', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '1', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '2', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '3', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '4', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '5', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '-199', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '-55', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '+200', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '-88', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '-11', top: '10%' }], background: '#e9e8fe' },
{ fonts: [{ text: '-299', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '+200', top: '10%' }], background: '#b8c5f2' },
{ fonts: [{ text: '-66', top: '10%' }], background: '#b8c5f2' },
])
const blocks = ref([{ padding: '13px', background: '#617df2' }])
const buttons = ref([{
@ -27,7 +29,7 @@ function startCallback() {
//
setTimeout(() => {
// 0
const index = 0
const index = 10
// stop
myLucky.value.stop(index)
}, 3000)
@ -40,6 +42,7 @@ function endCallback(prize) {
</script>
<template>
<dev>
<h1> 大转盘 </h1>
<div class="luckyWheel">
@ -47,6 +50,7 @@ function endCallback(prize) {
<LuckyWheel class="lucky" ref="myLucky" width="300px" height="300px" :default-config="wheelConfig"
:prizes="prizes" :blocks="blocks" :buttons="buttons" @start="startCallback" @end="endCallback" />
</div>
</dev>
</template>
<style scoped></style>

5
vite.config.js

@ -1,7 +1,12 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
host: '192.168.1.102', // 监听所有 IP
port: 5173 // 指定端口(可选)
}
})
Loading…
Cancel
Save