-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
156 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Component({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<t-cell title="标题文字"> | ||
<t-stepper defaultValue="0" slot="right-icon" /> | ||
</t-cell> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Component({ | ||
data: { | ||
value: 20, | ||
}, | ||
|
||
methods: { | ||
handleChange(e) { | ||
const { value } = e.detail; | ||
|
||
console.log(value); | ||
this.setData({ | ||
value, | ||
}); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<!-- 受控用法 --> | ||
<t-stepper value="{{value}}" bind:change="handleChange" theme="grey" inputWidth="{{72}}" /> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Component({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<t-cell title="最小值 (5)"> | ||
<t-stepper defaultValue="5" min="5" slot="right-icon" /> | ||
</t-cell> | ||
<view class="interval" /> | ||
<t-cell title="最大值 (999)"> | ||
<t-stepper defaultValue="999" max="999" slot="right-icon" /> | ||
</t-cell> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Component({ | ||
data: { | ||
value: 20, | ||
}, | ||
|
||
methods: { | ||
handleChange(e) { | ||
const { value } = e.detail; | ||
|
||
console.log(value); | ||
this.setData({ | ||
value, | ||
}); | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<view class="pure-stepper-container"> | ||
<t-stepper disabled value="3" theme="grey" inputWidth="{{72}}" /> | ||
<t-stepper defaultValue="0" max="99" theme="grey" inputWidth="{{72}}" /> | ||
<t-stepper defaultValue="100" theme="grey" inputWidth="{{72}}" /> | ||
</view> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.pure-stepper-container { | ||
padding: 24rpx 32rpx; | ||
background-color: #fff; | ||
display: flex; | ||
justify-content: space-between; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Component({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<t-cell title="禁用"> | ||
<t-stepper disabled="true" slot="right-icon" /> | ||
</t-cell> | ||
<t-cell title="禁用(单位)"> | ||
<t-stepper step="2" disabled="true" slot="right-icon" /> | ||
</t-cell> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Component({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"t-cell": "tdesign-miniprogram/cell/cell", | ||
"t-stepper": "tdesign-miniprogram/stepper/stepper" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<t-cell title="标题文字(单位)"> | ||
<t-stepper defaultValue="0" step="2" slot="right-icon" /> | ||
</t-cell> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
{ | ||
"navigationBarTitleText": "Stepper 步进器", | ||
"usingComponents": { | ||
"t-demo": "../../components/demo-block/index" | ||
"t-demo": "../../components/demo-block/index", | ||
"base": "./base", | ||
"step": "./step", | ||
"input-width": "./input-width", | ||
"other": "./other", | ||
"status": "./status", | ||
"min-max": "./min-max" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,10 @@ | ||
.t-stepper { | ||
&-title, | ||
&-desc { | ||
margin: 0 32rpx; | ||
} | ||
|
||
&-title { | ||
padding-top: 48rpx; | ||
font-size: 40rpx; | ||
font-weight: 500; | ||
line-height: 56rpx; | ||
} | ||
|
||
&-desc { | ||
color: rgba(0, 0, 0, 0.4); | ||
margin-top: 16rpx; | ||
font-size: 26rpx; | ||
line-height: 36rpx; | ||
} | ||
} | ||
|
||
.t-stepper-wrapper { | ||
margin-top: 40rpx; | ||
margin-bottom: 8rpx; | ||
|
||
&-title, | ||
&-desc { | ||
margin: 0 32rpx; | ||
} | ||
|
||
&-title { | ||
color: rgba(0, 0, 0, 0.9); | ||
font-size: 32rpx; | ||
font-weight: 500; | ||
line-height: 48rpx; | ||
margin-bottom: 16rpx; | ||
} | ||
|
||
&-desc { | ||
margin: 32rpx; | ||
color: rgba(0, 0, 0, 0.4); | ||
font-size: 26rpx; | ||
line-height: 36rpx; | ||
white-space: pre-line; | ||
} | ||
} | ||
|
||
.pure-stepper-container { | ||
padding: 24rpx 32rpx; | ||
background-color: #fff; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.interval { | ||
height: 32rpx; | ||
.t-cell { | ||
margin-bottom: 32rpx; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1 @@ | ||
Page({ | ||
data: { | ||
value: 20, | ||
}, | ||
|
||
handleChange(e) { | ||
const { value } = e.detail; | ||
|
||
console.log(value); | ||
this.setData({ | ||
value, | ||
}); | ||
}, | ||
}); | ||
Page({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,22 @@ | ||
<view class="page"> | ||
<view class="t-stepper-title">Stepper 步进器</view> | ||
<view class="t-stepper-desc">用于数量的增减。</view> | ||
<view class="demo"> | ||
<view class="demo-title">Stepper 步进器</view> | ||
<view class="demo-desc">用于数量的增减。</view> | ||
<t-demo title="01 类型" desc="基本步进器"> | ||
<t-cell title="标题文字"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper defaultValue="0" /> | ||
</view> | ||
</t-cell> | ||
<view class="t-stepper-wrapper-desc">带单位步进器</view> | ||
<t-cell title="标题文字(单位)"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper defaultValue="0" step="2" /> | ||
</view> | ||
</t-cell> | ||
<view class="t-stepper-wrapper-desc">纯步进器</view> | ||
<base /> | ||
</t-demo> | ||
<t-demo desc="带单位步进器"> | ||
<step /> | ||
</t-demo> | ||
<t-demo desc="纯步进器"> | ||
<view class="pure-stepper-container"> | ||
<t-stepper value="{{value}}" bind:change="handleChange" theme="grey" inputWidth="{{72}}" /> | ||
<input-width /> | ||
</view> | ||
</t-demo> | ||
|
||
<t-demo title="02 状态" desc="步进器状态"> | ||
<view class="stepper-content"> | ||
<t-cell title="禁用"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper disabled="true" /> | ||
</view> | ||
</t-cell> | ||
<view class="interval" /> | ||
<t-cell title="禁用(单位)"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper step="2" disabled="true" /> | ||
</view> | ||
</t-cell> | ||
<view class="interval" /> | ||
<t-cell title="最小值 (5)"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper defaultValue="5" min="5" /> | ||
</view> | ||
</t-cell> | ||
<view class="interval" /> | ||
<t-cell title="最大值 (999)"> | ||
<view class="cell-badge-wrap" slot="right-icon"> | ||
<t-stepper defaultValue="999" max="999" /> | ||
</view> | ||
</t-cell> | ||
<view class="interval" /> | ||
<view class="pure-stepper-container"> | ||
<t-stepper disabled value="3" theme="grey" inputWidth="{{72}}" /> | ||
<t-stepper defaultValue="0" max="99" theme="grey" inputWidth="{{72}}" /> | ||
<t-stepper defaultValue="100" theme="grey" inputWidth="{{72}}" /> | ||
</view> | ||
<view class="interval" /> | ||
<view class="interval" /> | ||
<status /> | ||
<min-max /> | ||
<other /> | ||
</view> | ||
</t-demo> | ||
</view> |