Skip to content

Commit 96f87b5

Browse files
committed
added button type prop
1 parent 4a5bb43 commit 96f87b5

File tree

5 files changed

+41
-1
lines changed

5 files changed

+41
-1
lines changed

dist/vue-typed-ui.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,17 @@ var _ButtonBase = function (_Vue) {
16141614

16151615
function _ButtonBase() {
16161616
classCallCheck(this, _ButtonBase);
1617-
return possibleConstructorReturn(this, (_ButtonBase.__proto__ || Object.getPrototypeOf(_ButtonBase)).apply(this, arguments));
1617+
1618+
/**
1619+
* Button type
1620+
*
1621+
* @default 'button'
1622+
* @type {string}
1623+
*/
1624+
var _this = possibleConstructorReturn(this, (_ButtonBase.__proto__ || Object.getPrototypeOf(_ButtonBase)).apply(this, arguments));
1625+
1626+
_this.type = 'button';
1627+
return _this;
16181628
}
16191629

16201630
return _ButtonBase;
@@ -1633,6 +1643,9 @@ __decorate([vueTyped.Prop()], _ButtonBase.prototype, "float", void 0);
16331643
__decorate([vueTyped.Prop({
16341644
type: String
16351645
})], _ButtonBase.prototype, "color", void 0);
1646+
__decorate([vueTyped.Prop({
1647+
type: String
1648+
})], _ButtonBase.prototype, "type", void 0);
16361649

16371650
var Button = function (_ButtonBase2) {
16381651
inherits(Button, _ButtonBase2);
@@ -1673,6 +1686,9 @@ var Button = function (_ButtonBase2) {
16731686
css += ' ' + this.color;
16741687
}
16751688
var el = ch('button', {
1689+
attrs: {
1690+
type: this.type
1691+
},
16761692
on: {
16771693
'click': this.click
16781694
},

doc/api.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@
112112
"size": {
113113
"type": "'mini' | 'tiny' | 'small' | 'medium' | 'large' | 'big' | 'huge' | 'massive'",
114114
"description": "Button size"
115+
},
116+
"type": {
117+
"type": "string",
118+
"description": "Button type",
119+
"default": "'button'"
115120
}
116121
}
117122
},

src/components/form-inputs/button/_base.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,15 @@ export abstract class _ButtonBase extends Vue {
7070
})
7171
color: string
7272

73+
/**
74+
* Button type
75+
*
76+
* @default 'button'
77+
* @type {string}
78+
*/
79+
@Prop({
80+
type: String
81+
})
82+
type: string = 'button'
83+
7384
}

src/components/form-inputs/button/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ export class Button extends _ButtonBase {
4343
}
4444

4545
var el = ch('button', {
46+
attrs: {
47+
type: this.type
48+
},
4649
on: {
4750
'click': this.click
4851
},

src/components/form-inputs/button/schema/props.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"color": {
3131
"type": "string",
3232
"description": "Button color name"
33+
},
34+
"type": {
35+
"type": "string",
36+
"description": "Button type",
37+
"default": "'button'"
3338
}
3439
}
3540
}

0 commit comments

Comments
 (0)