diff --git a/src/components/button/button.vue b/src/components/button/button.vue
index 0bd5d3f..7413b6f 100644
--- a/src/components/button/button.vue
+++ b/src/components/button/button.vue
@@ -38,7 +38,11 @@
return oneOf(value, ['button', 'submit', 'reset']);
}
},
- icon: String
+ icon: String,
+ long: {
+ type: Boolean,
+ default: false
+ }
},
data () {
return {
@@ -51,6 +55,7 @@
`${prefixCls}`,
{
[`${prefixCls}-${this.type}`]: !!this.type,
+ [`${prefixCls}-long`]: this.long,
[`${prefixCls}-${this.shape}`]: !!this.shape,
[`${prefixCls}-${this.size}`]: !!this.size,
[`${prefixCls}-loading`]: this.loading != null && this.loading,
@@ -70,7 +75,7 @@
]
}
},
- ready () {
+ compiled () {
this.showSlot = this.$els.slot.innerHTML.replace(/\n/g, '').replace(//gmi, '') !== '';
}
}
diff --git a/src/styles/components/button.less b/src/styles/components/button.less
index 27cae36..39ca7f6 100644
--- a/src/styles/components/button.less
+++ b/src/styles/components/button.less
@@ -4,6 +4,10 @@
.btn;
.btn-default;
+ &-long{
+ width: 100%;
+ }
+
& > .ivu-icon + span, & > span + .ivu-icon{
margin-left: 4px;
}
diff --git a/test/routers/button.vue b/test/routers/button.vue
index 4f4bd77..6345778 100644
--- a/test/routers/button.vue
+++ b/test/routers/button.vue
@@ -5,6 +5,11 @@
+