-
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.
Merge pull request #615 from wangyuan0108/docs/switch
Docs/switch
- Loading branch information
Showing
11 changed files
with
76 additions
and
45 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,10 @@ | ||
Component({ | ||
data: { | ||
defaultVal: true, | ||
}, | ||
handleChange(e) { | ||
this.setData({ | ||
defaultVal: e.detail.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,3 @@ | ||
{ | ||
"component": true | ||
} |
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,26 @@ | ||
<view class="group"> | ||
<t-cell title="默认"> | ||
<t-switch defaultValue="{{true}}"></t-switch> | ||
</t-cell> | ||
<t-cell title="默认关"> | ||
<t-switch defaultValue="{{false}}"></t-switch> | ||
</t-cell> | ||
<t-cell title="自定义颜色"> | ||
<t-switch defaultValue="{{true}}" colors="{{['#00A870']}}"></t-switch> | ||
</t-cell> | ||
<t-cell title="异步操作" bordered="{{false}}"> | ||
<t-switch defaultValue="{{true}}"></t-switch> | ||
</t-cell> | ||
</view> | ||
|
||
<view class="group"> | ||
<t-cell title="默认"> | ||
<t-switch bindchange="handleChange" value="{{defaultVal}}" label="描述信息"></t-switch> | ||
</t-cell> | ||
<t-cell title="默认关"> | ||
<t-switch defaultValue="{{false}}" label="描述信息"></t-switch> | ||
</t-cell> | ||
<t-cell title="自定义颜色" bordered="{{false}}"> | ||
<t-switch defaultValue="{{true}}" colors="{{['#00A870']}}" label="描述信息"></t-switch> | ||
</t-cell> | ||
</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,3 @@ | ||
.group { | ||
margin-top: 24px; | ||
} |
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,3 @@ | ||
{ | ||
"component": true | ||
} |
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,12 @@ | ||
<t-cell title="开关"> | ||
<t-switch defaultValue="{{true}}" disabled></t-switch> | ||
</t-cell> | ||
<t-cell title="开关"> | ||
<t-switch defaultValue="{{false}}" disabled></t-switch> | ||
</t-cell> | ||
<t-cell title="开关"> | ||
<t-switch defaultValue="{{true}}" label="描述信息" disabled></t-switch> | ||
</t-cell> | ||
<t-cell title="开关" bordered="{{false}}"> | ||
<t-switch defaultValue="{{false}}" label="描述信息" disabled></t-switch> | ||
</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,8 @@ | ||
{ | ||
"navigationBarTitleText": "Switch", | ||
"usingComponents": { | ||
"t-demo": "../../components/demo-block" | ||
"t-demo": "../../components/demo-block", | ||
"base": "./base", | ||
"status": "./status" | ||
} | ||
} |
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