File tree Expand file tree Collapse file tree 7 files changed +38
-19
lines changed Expand file tree Collapse file tree 7 files changed +38
-19
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,13 @@ url : pages/vue/badge/badge
3030
3131### Badge Props
3232
33- | 属性名 | 类型 | 默认值 | 说明 |
34- | :-: | :-: | :-: | :-: |
35- | text | String | - | 角标内容 |
36- | type | String | default| 颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
37- | size | String | normal| Badge 大小,可取值:normal、small|
38- | inverted | Boolean | false | 是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
33+ | 属性名 | 类型 | 默认值 | 说明 |
34+ | :-: | :-: | :-: | :-: |
35+ | text | String | - | 角标内容 |
36+ | type | String | default| 颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
37+ | size | String | normal | Badge 大小,可取值:normal、small |
38+ | custom-style | String | | 自定义 Badge 样式 |
39+ | inverted | Boolean| false | 是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
3940
4041### Badge Events
4142
Original file line number Diff line number Diff line change 2525 <uni-badge class="uni-badge-left-margin" text="45" type="warning" size="small" />
2626 <uni-badge class="uni-badge-left-margin" text="123" type="error" size="small" />
2727 </view>
28+ <uni-section title="自定义样式" type="line"></uni-section>
29+ <view class="example-body">
30+ <uni-badge class="uni-badge-left-margin" text="2" type="primary" customStyle="background-color: #2C405A; color: #fff;" />
31+ <uni-badge class="uni-badge-left-margin" text="2" type="primary" customStyle="background-color: #2C405A; color: red;" />
32+ </view>
2833 </view>
2934</template>
3035
Original file line number Diff line number Diff line change 2525 <uni-badge class =" uni-badge-left-margin" text =" 45" type =" warning" size =" small" />
2626 <uni-badge class =" uni-badge-left-margin" text =" 123" type =" error" size =" small" />
2727 </view >
28+ <uni-section title =" 自定义样式" type =" line" ></uni-section >
29+ <view class =" example-body" >
30+ <uni-badge class =" uni-badge-left-margin" text =" 2" type =" primary" customStyle =" background-color: #2C405A; color: #fff;" />
31+ <uni-badge class =" uni-badge-left-margin" text =" 2" type =" primary" customStyle =" background-color: #2C405A; color: red;" />
32+ </view >
2833 </view >
2934</template >
3035
Original file line number Diff line number Diff line change 1+ ## 1.0.7(2021-05-07)
2+ - 修复 uni-badge 在 App 端,数字小于10时不是圆形的bug
3+ - 修复 uni-badge 在父元素不是 flex 布局时,宽度缩小的bug
4+ - 新增 uni-badge 属性 custom-style, 支持自定义样式
15## 1.0.6(2021-02-04)
26- 调整为uni_modules目录规范
Original file line number Diff line number Diff line change 4040 size: {
4141 type: String ,
4242 default: ' normal'
43+ },
44+ customStyle: {
45+ type: String ,
46+ default: ' '
4347 }
4448 },
4549 data () {
5761 },
5862 methods: {
5963 setStyle () {
60- this .badgeStyle = ` width: ${ String (this .text ).length * 8 + 12 } px`
64+ this .badgeStyle = ` width: ${ String (this .text ).length * 8 + 12 } px; ` + this . customStyle
6165 },
6266 onClick () {
6367 this .$emit (' click' );
7175 $bage-small : scale (0.8 );
7276 $bage-height : 20px ;
7377
74- .uni-badge {
75- /* #ifndef APP-PLUS */
78+ .uni-badge {
79+ /* #ifndef APP-NVUE */
7680 display : flex ;
81+ overflow : hidden ;
7782 box-sizing : border-box ;
78- overflow : hidden ;
7983 /* #endif */
8084 justify-content : center ;
81- flex-direction : row ;
85+ flex-direction : row ;
8286 height : $bage-height ;
8387 line-height : $bage-height ;
8488 color : $uni-text-color ;
8892 text-align : center ;
8993 font-family : ' Helvetica Neue' , Helvetica , sans-serif ;
9094 font-size : $bage-size ;
91- padding : 0px 6px ;
9295 /* #ifdef H5 */
9396 cursor : pointer ;
9497 /* #endif */
Original file line number Diff line number Diff line change 11{
22 "id" : " uni-badge" ,
33 "displayName" : " uni-badge 数字角标" ,
4- "version" : " 1.0.6 " ,
4+ "version" : " 1.0.7 " ,
55 "description" : " 数字角标(徽章)组件,在元素周围展示消息提醒,一般用于列表、九宫格、按钮等地方。" ,
66 "keywords" : [
77 " " ,
Original file line number Diff line number Diff line change 2828
2929### Badge Props
3030
31- | 属性名 | 类型 | 默认值 | 说明 |
32- | :-: | :-: | :-: | :-: |
33- | text | String | - | 角标内容 |
34- | type | String | default| 颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
35- | size | String | normal| Badge 大小,可取值:normal、small|
36- | inverted | Boolean | false | 是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
31+ | 属性名 | 类型 | 默认值 | 说明 |
32+ | :-: | :-: | :-: | :-: |
33+ | text | String | - | 角标内容 |
34+ | type | String | default| 颜色类型,可选值:default(灰色)、primary(蓝色)、success(绿色)、warning(黄色)、error(红色)|
35+ | size | String | normal | Badge 大小,可取值:normal、small |
36+ | custom-style | String | | 自定义 Badge 样式 |
37+ | inverted | Boolean| false | 是否无需背景颜色,为 true 时,背景颜色将变为文字的字体颜色 |
3738
3839### Badge Events
3940
You can’t perform that action at this time.
0 commit comments