-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 新增 range custom * fix: 重命名标签 * fix: 修复 axml * chore: 更新 css * feat: 更新 demo --------- Co-authored-by: DiamondYuan <fandi.yfd@antgroup.com>
- Loading branch information
1 parent
e3089b1
commit 37a9f08
Showing
27 changed files
with
314 additions
and
176 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 |
---|---|---|
@@ -1,84 +1,84 @@ | ||
<container title="自定义间距"> | ||
<rate | ||
defaultValue="{{3}}" | ||
gutter="{{8}}" /> | ||
<ant-container title="自定义间距"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
gutter="{{ 8 }}" /> | ||
<view class="description">8px</view> | ||
|
||
<rate | ||
defaultValue="{{4}}" | ||
gutter="{{16}}" /> | ||
<ant-rate | ||
defaultValue="{{ 4 }}" | ||
gutter="{{ 16 }}" /> | ||
<view class="description">16px</view> | ||
</container> | ||
</ant-container> | ||
|
||
<container title="自定义大小"> | ||
<rate | ||
defaultValue="{{3}}" | ||
<ant-container title="自定义大小"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
className="rate" /> | ||
<view class="description">30px</view> | ||
|
||
<rate | ||
defaultValue="{{3}}" | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
style="font-size: 40px" /> | ||
<view class="description">40px</view> | ||
</container> | ||
</ant-container> | ||
|
||
<container title="自定义颜色"> | ||
<rate | ||
defaultValue="{{3}}" | ||
<ant-container title="自定义颜色"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
characterClassName="star" | ||
characterActiveClassName="star-active" /> | ||
<view class="description">基础</view> | ||
|
||
<rate | ||
defaultValue="{{3}}" | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
characterClassName="star-gradient" | ||
characterActiveClassName="star-active-gradient" /> | ||
<view class="description">渐变</view> | ||
</container> | ||
</ant-container> | ||
|
||
<container title="自定义图标"> | ||
<rate defaultValue="{{3}}"> | ||
<icon | ||
<ant-container title="自定义图标"> | ||
<ant-rate defaultValue="{{ 3 }}"> | ||
<ant-icon | ||
slot="character" | ||
type="HeartFill" /> | ||
</rate> | ||
</ant-rate> | ||
<view class="description">自定义为HeartFill</view> | ||
|
||
<rate | ||
defaultValue="{{3.5}}" | ||
<ant-rate | ||
defaultValue="{{ 3.5 }}" | ||
allowHalf> | ||
<icon | ||
<ant-icon | ||
slot="character" | ||
type="StarOutline" /> | ||
</rate> | ||
</ant-rate> | ||
<view class="description">自定义为StarOutline</view> | ||
|
||
<rate | ||
defaultValue="{{3.5}}" | ||
<ant-rate | ||
defaultValue="{{ 3.5 }}" | ||
allowHalf | ||
characterClassName="character"> | ||
<view slot="character">正</view> | ||
</rate> | ||
</ant-rate> | ||
<view class="description">自定义为正</view> | ||
|
||
<rate | ||
defaultValue="{{2.5}}" | ||
<ant-rate | ||
defaultValue="{{ 2.5 }}" | ||
allowHalf | ||
characterClassName="character"> | ||
<view slot="character">A</view> | ||
</rate> | ||
</ant-rate> | ||
<view class="description">自定义为A</view> | ||
|
||
<rate | ||
defaultValue="{{2.5}}" | ||
<ant-rate | ||
defaultValue="{{ 2.5 }}" | ||
allowHalf | ||
gutter="{{20}}" | ||
gutter="{{ 20 }}" | ||
characterClassName="character"> | ||
<view | ||
slot="character" | ||
slot-scope="rate"> | ||
{{rate.index}} | ||
{{ rate.index }} | ||
</view> | ||
</rate> | ||
</ant-rate> | ||
<view class="description">自定义为索引</view> | ||
</container> | ||
</ant-container> |
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,5 +1,5 @@ | ||
Page({ | ||
onChange (value) { | ||
console.log(value); | ||
}, | ||
onChange: function (value) { | ||
console.log(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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"defaultTitle": "Rate", | ||
"usingComponents": { | ||
"rate": "../../../src/Rate/index", | ||
"icon": "../../../src/Icon/index", | ||
"container": "../../../src/Container/index" | ||
"ant-rate": "../../../src/Rate/index", | ||
"ant-icon": "../../../src/Icon/index", | ||
"ant-container": "../../../src/Container/index" | ||
}, | ||
"allowsBounceVertical": "NO" | ||
} |
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
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,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"icon": "../Icon/index" | ||
"component": true, | ||
"usingComponents": { | ||
"ant-icon": "../Icon/index" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -35,4 +35,5 @@ | |
overflow: hidden; | ||
} | ||
} | ||
|
||
} |
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
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 @@ | ||
Page({ | ||
onChange: function (value) { | ||
console.log(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,9 @@ | ||
{ | ||
"defaultTitle": "Rate", | ||
"usingComponents": { | ||
"ant-rate": "../../../src/Rate/index", | ||
"ant-icon": "../../../src/Icon/index", | ||
"ant-container": "../../../src/Container/index" | ||
}, | ||
"allowsBounceVertical": "NO" | ||
} |
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,37 @@ | ||
<ant-container title="自定义间距"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
gutter="{{ 8 }}" /> | ||
<view class="description">8px</view> | ||
|
||
<ant-rate | ||
defaultValue="{{ 4 }}" | ||
gutter="{{ 16 }}" /> | ||
<view class="description">16px</view> | ||
</ant-container> | ||
|
||
<ant-container title="自定义大小"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
className="rate" /> | ||
<view class="description">30px</view> | ||
|
||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
style="font-size: 40px" /> | ||
<view class="description">40px</view> | ||
</ant-container> | ||
|
||
<ant-container title="自定义颜色"> | ||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
characterClassName="star" | ||
characterActiveClassName="star-active" /> | ||
<view class="description">基础</view> | ||
|
||
<ant-rate | ||
defaultValue="{{ 3 }}" | ||
characterClassName="star-gradient" | ||
characterActiveClassName="star-active-gradient" /> | ||
<view class="description">渐变</view> | ||
</ant-container> |
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,23 @@ | ||
.star { | ||
color: #767676; | ||
} | ||
.star-active { | ||
color: red !important; | ||
} | ||
.description { | ||
margin: 4px 0 16px 0; | ||
color: #333333; | ||
} | ||
.star-gradient { | ||
background-image: linear-gradient(to right, #979797, #ffffff); | ||
-webkit-background-clip: text; | ||
color: transparent !important; | ||
} | ||
.star-active-gradient { | ||
background-image: linear-gradient(to right, orange, yellow); | ||
-webkit-background-clip: text; | ||
color: transparent !important; | ||
} | ||
.character { | ||
font-size: 40px; | ||
} |
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,6 @@ | ||
{ | ||
"component": true, | ||
"usingComponents": { | ||
"icon": "../Icon/index" | ||
"component": true, | ||
"usingComponents": { | ||
"ant-icon": "../Icon/index" | ||
} | ||
} |
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
Oops, something went wrong.