feat:更新

This commit is contained in:
dengtongyu committed 2021-08-28 14:00:39 +08:00
1 parent ee99434860
commit 03c799e6a5
3 files changed
+28 -3

No files matched your search

+1
View File
@@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"core-js": "^3.6.4", "core-js": "^3.6.4",
"vant": "^2.12.26",
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-luck-draw": "^3.4.6", "vue-luck-draw": "^3.4.6",
"vue-router": "^3.1.6", "vue-router": "^3.1.6",
+1 -1
View File
@@ -12,7 +12,7 @@ module.exports = {
"postcss-design-convert": { "postcss-design-convert": {
multiple: 2, multiple: 2,
units: ["vw"], units: ["vw"],
selector: /^\.yzy-/ selector: /^\.van-/
}, },
"postcss-write-svg": { "postcss-write-svg": {
utf8: false utf8: false
+26 -2
View File
@@ -1,9 +1,9 @@
<template> <template>
<div class="home"> <div class="home">
<div class="lucky-box">
<LuckyGrid <LuckyGrid
class="lucky-grid"
ref="LuckDraw" ref="LuckDraw"
width="400px"
height="200px"
rows="2" rows="2"
cols="4" cols="4"
:prizes="prizes" :prizes="prizes"
@@ -14,6 +14,7 @@
@start="startCallBack" @start="startCallBack"
@end="endCallBack" @end="endCallBack"
/> />
</div>
<button @click="clickHander">抽奖</button> <button @click="clickHander">抽奖</button>
</div> </div>
@@ -146,6 +147,12 @@ export default {
this.prizes = prizes; this.prizes = prizes;
}, 0); }, 0);
}, },
unitFunc(num, unit) {
console.log(num, unit);
if (unit === "vw") {
return (window.innerWidth / 100) * num;
}
},
startCallBack() { startCallBack() {
if (!this.luckyNum) return alert("还剩0次抽奖机会"); if (!this.luckyNum) return alert("还剩0次抽奖机会");
this.$refs.LuckDraw.play(); this.$refs.LuckDraw.play();
@@ -163,3 +170,20 @@ export default {
} }
}; };
</script> </script>
<style lang="scss" scoped>
.home {
padding: 30px;
height: 100%;
box-sizing: border-box;
.lucky-box {
width: 600px;
height: 300px;
margin: 0 auto;
.lucky-grid {
width: 100%;
height: 100%;
}
}
}
</style>