Skip to content

Commit 44cf735

Browse files
committed
Button add inline prop
1 parent c634aa7 commit 44cf735

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

examples/pages/button/index.wxml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<i-panel title="一般用法"></i-panel>
22

3+
<i-button bind:click="handleClick" inline>行内按钮</i-button>
4+
<i-button bind:click="handleClick" inline type="primary">行内按钮</i-button>
5+
<i-button bind:click="handleClick" inline type="success">行内按钮</i-button>
6+
37
<i-button bind:click="handleClick">默认按钮</i-button>
48
<i-button bind:click="handleClick" type="error" long="true">联通两边按钮</i-button>
59
<i-button bind:click="handleClick" type="primary">Primary</i-button>

src/button/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ Component({
77
type: String,
88
value: '',
99
},
10+
inline: {
11+
type: Boolean,
12+
value: false
13+
},
1014
// default, large, small
1115
size: {
1216
type: String,

src/button/index.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@
116116
color: @btn-disable-color !important;
117117
background: @btn-disable-bg !important;
118118
}
119+
120+
&-inline{
121+
display: inline-block;
122+
}
119123
}
120124
@keyframes btn-spin {
121125
0% {

src/button/index.wxml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<button
2-
class="i-class i-btn {{ long ? 'i-btn-long' : '' }} {{ 'i-btn-' + size }} {{ 'i-btn-' + type }} {{ 'i-btn-' + shape }} {{ loading ? 'i-btn-loading' : '' }} {{ disabled ? 'i-btn-disabled' : ''}}"
2+
class="i-class i-btn {{ long ? 'i-btn-long' : '' }} {{ 'i-btn-' + size }} {{ 'i-btn-' + type }} {{ 'i-btn-' + shape }} {{ loading ? 'i-btn-loading' : '' }} {{ disabled ? 'i-btn-disabled' : ''}} {{ inline ? 'i-btn-inline' : '' }}"
33
bindtap="handleTap"
44
open-type="{{ openType }}"
55
app-parameter="{{ appParameter }}"

0 commit comments

Comments
 (0)