Skip to content

Commit

Permalink
build: upgrade to v1.7.23 修改宽高默认取元素本身的属性
Browse files Browse the repository at this point in the history
  • Loading branch information
buuing committed Apr 23, 2022
1 parent 5a8a73d commit 3d03ca1
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 49 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lucky-canvas",
"version": "1.7.22",
"version": "1.7.23",
"description": "一个基于原生 js 的(大转盘 / 九宫格 / 老虎机)抽奖插件",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export default class LuckyGrid extends Lucky {
* @param data
*/
private initData (data: LuckyGridConfig): void {
this.$set(this, 'width', data.width || '300px')
this.$set(this, 'height', data.height || '300px')
this.$set(this, 'width', data.width)
this.$set(this, 'height', data.height)
this.$set(this, 'rows', Number(data.rows) || 3)
this.$set(this, 'cols', Number(data.cols) || 3)
this.$set(this, 'blocks', data.blocks || [])
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/slot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ export default class SlotMachine extends Lucky {
* @param data
*/
private initData (data: SlotMachineConfig): void {
this.$set(this, 'width', data.width || '300px')
this.$set(this, 'height', data.height || '300px')
this.$set(this, 'width', data.width)
this.$set(this, 'height', data.height)
this.$set(this, 'blocks', data.blocks || [])
this.$set(this, 'prizes', data.prizes || [])
this.$set(this, 'slots', data.slots || [])
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/lib/wheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default class LuckyWheel extends Lucky {
* @param data
*/
private initData (data: LuckyWheelConfig): void {
this.$set(this, 'width', data.width || '300px')
this.$set(this, 'height', data.height || '300px')
this.$set(this, 'width', data.width)
this.$set(this, 'height', data.height)
this.$set(this, 'blocks', data.blocks || [])
this.$set(this, 'prizes', data.prizes || [])
this.$set(this, 'buttons', data.buttons || [])
Expand Down
4 changes: 2 additions & 2 deletions packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lucky-canvas/react",
"version": "0.1.7",
"version": "0.1.10",
"description": "react ( 大转盘 / 九宫格 / 老虎机 ) 抽奖插件",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down Expand Up @@ -45,6 +45,6 @@
"rollup-plugin-terser": "^7.0.2"
},
"dependencies": {
"lucky-canvas": "^1.7.21"
"lucky-canvas": "^1.7.23"
}
}
4 changes: 2 additions & 2 deletions packages/vue/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lucky-canvas/vue",
"version": "0.1.9",
"version": "0.1.10",
"description": "一个支持 vue2 / vue3 的(大转盘 / 九宫格 / 老虎机)luckydraw 抽奖插件",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down Expand Up @@ -32,7 +32,7 @@
"homepage": "https://100px.net",
"dependencies": {
"@vue/composition-api": "^1.0.0",
"lucky-canvas": "^1.7.21",
"lucky-canvas": "^1.7.23",
"vue-demi": "^0.7.4"
},
"peerDependencies": {
Expand Down
4 changes: 0 additions & 4 deletions packages/vue/src/components/LuckyGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ export default defineComponent({
props: {
width: {
type: [String, Number],
default: '300px',
require: true
},
height: {
type: [String, Number],
default: '300px',
require: true
},
cols: {
type: [String, Number],
Expand Down
4 changes: 0 additions & 4 deletions packages/vue/src/components/LuckyWheel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ export default defineComponent({
props: {
width: {
type: [String, Number],
default: '300px',
require: true
},
height: {
type: [String, Number],
default: '300px',
require: true
},
blocks: {
type: Array,
Expand Down
4 changes: 0 additions & 4 deletions packages/vue/src/components/SlotMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,9 @@ export default defineComponent({
props: {
width: {
type: [String, Number],
default: '300px',
require: true
},
height: {
type: [String, Number],
default: '300px',
require: true
},
blocks: {
type: Array,
Expand Down
36 changes: 10 additions & 26 deletions packages/vue/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@ import { LuckyWheel, LuckyGrid, SlotMachine } from 'lucky-canvas';
declare const _default$3: vue_demi.DefineComponent<{
width: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
height: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
blocks: {
type: ArrayConstructor;
Expand Down Expand Up @@ -51,11 +47,12 @@ declare const _default$3: vue_demi.DefineComponent<{
blocks: unknown[];
prizes: unknown[];
buttons: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
defaultConfig: Record<string, any>;
} & {}> & {
} & {
width?: string | number | undefined;
height?: string | number | undefined;
}> & {
onStart?: ((...args: any[]) => any) | undefined;
onEnd?: ((...args: any[]) => any) | undefined;
onSuccess?: ((...args: any[]) => any) | undefined;
Expand All @@ -65,22 +62,16 @@ declare const _default$3: vue_demi.DefineComponent<{
blocks: unknown[];
prizes: unknown[];
buttons: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
defaultConfig: Record<string, any>;
}>;

declare const _default$2: vue_demi.DefineComponent<{
width: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
height: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
cols: {
type: (StringConstructor | NumberConstructor)[];
Expand Down Expand Up @@ -142,13 +133,13 @@ declare const _default$2: vue_demi.DefineComponent<{
blocks: unknown[];
prizes: unknown[];
buttons: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
activeStyle: Record<string, any>;
defaultConfig: Record<string, any>;
} & {
button?: Record<string, any> | undefined;
width?: string | number | undefined;
height?: string | number | undefined;
}> & {
onStart?: ((...args: any[]) => any) | undefined;
onEnd?: ((...args: any[]) => any) | undefined;
Expand All @@ -161,8 +152,6 @@ declare const _default$2: vue_demi.DefineComponent<{
blocks: unknown[];
prizes: unknown[];
buttons: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
activeStyle: Record<string, any>;
defaultConfig: Record<string, any>;
Expand All @@ -171,13 +160,9 @@ declare const _default$2: vue_demi.DefineComponent<{
declare const _default$1: vue_demi.DefineComponent<{
width: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
height: {
type: (StringConstructor | NumberConstructor)[];
default: string;
require: boolean;
};
blocks: {
type: ArrayConstructor;
Expand Down Expand Up @@ -218,16 +203,15 @@ declare const _default$1: vue_demi.DefineComponent<{
blocks: unknown[];
slots: unknown[];
prizes: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
defaultConfig: Record<string, any>;
} & {}>, {
} & {
width?: string | number | undefined;
height?: string | number | undefined;
}>, {
blocks: unknown[];
slots: unknown[];
prizes: unknown[];
width: string | number;
height: string | number;
defaultStyle: Record<string, any>;
defaultConfig: Record<string, any>;
}>;
Expand Down

0 comments on commit 3d03ca1

Please sign in to comment.