Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add image to wheel #8

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.DS_Store
node_modules
/dist
/lib
# /dist
# /lib
/public

# local env files
Expand Down
12 changes: 8 additions & 4 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ export default {
cavansVerify: true, // canvas 模式的转盘是否开启验证
prizes: [
{
id: 1, //* 每个奖品唯一的 id, 大于 0 的整数
id: '1', //* 每个奖品唯一的 id, 大于 0 的整数
contentType: 'text',
name: 'Blue', // 奖品名, type 为 canvas 时的显示值 (type 为 image 时无需此参数)
value: 'Blue\' value', //* 奖品值, 旋转结束后的返回值
bgColor: '#45ace9', // 背景色 (type 为 image 时无需此参数)
Expand All @@ -77,7 +78,8 @@ export default {
weight: 1 // 权重, 如果 useWeight 为 true, 则以 weight 计算概率 (即 probability 无效), weight 必须为整数
},
{
id: 2,
id: '2',
contentType: 'text',
name: 'Red',
value: 'Red\' value',
bgColor: '#dd3832',
Expand All @@ -86,8 +88,9 @@ export default {
weight: 1
},
{
id: 3,
name: 'Yellow',
id: '3',
contentType: 'image',
imageUri: 'https://perperook.ir/img/icons/offers.png',
value: 'Yellow\' value',
bgColor: '#fef151',
color: '#ffffff',
Expand Down Expand Up @@ -150,6 +153,7 @@ export default {
| canvas.textLength | 奖品一行几个字符, 超出换行 (最多两行) | Number | 6 |
| canvas.textDirection | 奖品文本方向 (horizontal, vertical) | String | horizontal |
| canvas.lineHeight | 文本行高 (type: canvas) | Number | 20 |
| canvas.imageSize | Image size (type: canvas) | Number | 64 |
| canvas.borderWidth | 圆的外边框 (type: canvas) | Number | 0 |
| canvas.borderColor | 外边框的色值 (type: canvas) | String | transparent |
| canvas.btnText | 按钮文本 (type: canvas) | String | GO |
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ export default {
},
prizes: [
{
id: 1, //* The unique id of each prize, an integer greater than 0
id: '1', //* The unique id of each prize, a string
contentType: 'text',
name: 'Blue', // Prize name, display value when type is canvas (this parameter is not needed when type is image)
value: 'Blue\'s value', //* Prize value, return value after spinning
bgColor: '#45ace9', // Background color (no need for this parameter when type is image)
Expand All @@ -80,7 +81,8 @@ export default {
weight: 1 // Weight, if useWeight is true, the probability is calculated by weight (weight must be an integer), so probability is invalid
},
{
id: 2,
id: '2',
contentType: 'text',
name: 'Red',
value: 'Red\'s value',
bgColor: '#dd3832',
Expand All @@ -89,8 +91,9 @@ export default {
weight: 1
},
{
id: 3,
name: 'Yellow',
id: '3',
contentType: 'image',
imageUri: 'https://perperook.ir/img/icons/offers.png',
value: 'Yellow\'s value',
bgColor: '#fef151',
color: '#ffffff',
Expand Down Expand Up @@ -153,6 +156,7 @@ export default {
| canvas.textLength | A few characters in one line of the prize, beyond the line break (maximum two lines) | Number | 6 |
| canvas.textDirection | Prize text direction (horizontal, vertical) | String | horizontal |
| canvas.lineHeight | Text line height (type: canvas) | Number | 20 |
| canvas.imageSize | Image size (type: canvas) | Number | 64 |
| canvas.borderWidth | Round outer border (type: canvas) | Number | 0 |
| canvas.borderColor | Color value of the outer border (type: canvas) | String | transparent |
| canvas.btnText | Button text (type: canvas) | String | GO |
Expand Down
10 changes: 10 additions & 0 deletions lib/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<meta charset="utf-8">
<title>vue-fortune-wheel demo</title>
<script src="./vue-fortune-wheel.umd.js"></script>

<link rel="stylesheet" href="./vue-fortune-wheel.css">


<script>
console.log(vue-fortune-wheel)
</script>
Loading