File tree Expand file tree Collapse file tree 6 files changed +60
-17
lines changed
examples/sites/demos/pc/app/tag Expand file tree Collapse file tree 6 files changed +60
-17
lines changed Original file line number Diff line number Diff line change 44 <tiny-tag type =" success" > 默认标签 </tiny-tag >
55 <tiny-tag size =" small" type =" success" > 小型标签 </tiny-tag >
66 <tiny-tag size =" mini" type =" success" > 超小标签 </tiny-tag >
7+ <br /><br />
8+ <tiny-tag size =" medium" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
9+ <tiny-tag type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
10+ <tiny-tag size =" small" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
11+ <tiny-tag size =" mini" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
712 </div >
813</template >
914
1015<script setup lang="jsx">
1116import { TinyTag } from '@opentiny/vue'
17+ import { IconHeartempty } from '@opentiny/vue-icon'
18+
19+ const TinyIconHeartempty = IconHeartempty()
1220 </script >
1321
1422<style >
Original file line number Diff line number Diff line change 44 <tiny-tag type =" success" > 默认标签 </tiny-tag >
55 <tiny-tag size =" small" type =" success" > 小型标签 </tiny-tag >
66 <tiny-tag size =" mini" type =" success" > 超小标签 </tiny-tag >
7+ <br /><br />
8+ <tiny-tag size =" medium" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
9+ <tiny-tag type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
10+ <tiny-tag size =" small" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
11+ <tiny-tag size =" mini" type =" success" only-icon > <tiny-icon-heartempty /> </tiny-tag >
712 </div >
813</template >
914
1015<script lang="jsx">
1116import { TinyTag } from '@opentiny/vue'
17+ import { IconHeartempty } from '@opentiny/vue-icon'
1218
1319export default {
1420 components: {
15- TinyTag
21+ TinyTag,
22+ TinyIconHeartempty: IconHeartempty()
1623 }
1724}
1825 </script >
Original file line number Diff line number Diff line change @@ -11,11 +11,13 @@ export default {
1111 desc : {
1212 'zh-CN' : `
1313 通过默认插槽,可以将文字和图标显示为一个标签。 <br>
14- 通过 <code>value</code> 属性,也可以设置标签值。
14+ 通过 <code>value</code> 属性,也可以设置标签值。 <br>
15+ 通过 <code>only-icon</code> 属性,设置标签只有图标。
1516 ` ,
1617 'en-US' : `
1718 Through the default slot, text and ICONS can be displayed as a label. <br>
18- Tag values can also be set using the <code>value</code> property.
19+ Tag values can also be set using the <code>value</code> property. <br>
20+ Use the <code>only-icon</code> property to set the label to only ICONS.
1921 `
2022 } ,
2123 codeFiles : [ 'basic-usage.vue' ]
Original file line number Diff line number Diff line change 6666 // 小型按钮最小宽度
6767 --tv-Button-min-width-small : 72px ;
6868 // 小型按钮内图标的大小
69- --tv-Button-size-icon-font-size-small : 14 px ;
69+ --tv-Button-size-icon-font-size-small : 16 px ;
7070 // 超小按钮字号
7171 --tv-Button-font-size-mini : var (--tv-font-size-sm );
7272 // 超小按钮高度
Original file line number Diff line number Diff line change 2929 text-overflow : ellipsis ;
3030 overflow : hidden ;
3131
32+ & .@{tag-prefix-cls} --only-icon.@{tag-prefix-cls} --only-icon.@{tag-prefix-cls} --only-icon {
33+ padding : var (--tv-Tag-only-icon-padding );
34+
35+ svg {
36+ font-size : var (--tv-Tag-only-icon-font-size );
37+ margin-right : 0 ; // 此时不需要右边距了
38+ }
39+ }
40+
3241 /* * size 场景 */
3342 .size-mixin (@size ) {
3443 @fs : %(' var(--tv-Tag-font-size%a)' , @size );
3544 @px : %(' var(--tv-Tag-padding-x%a)' , @size );
3645 @py : %(' var(--tv-Tag-padding-y%a)' , @size );
3746 @br : %(' var(--tv-Tag-border-radius%a)' , @size );
47+ @icon-fs : %(' var(--tv-Tag-only-icon-font-size%a)' , @size );
48+ @icon-py : %(' var(--tv-Tag-only-icon-padding%a)' , @size );
3849
3950 font-size : e (@fs );
4051 padding : e (@py ) e (@px );
4152 border-radius : e (@br );
53+
54+ & .@{tag-prefix-cls} --only-icon.@{tag-prefix-cls} --only-icon {
55+ padding : e (@icon-py );
56+
57+ svg {
58+ font-size : e (@icon-fs );
59+ margin-right : 0 ; // 此时不需要右边距了
60+ }
61+ }
4262 }
4363
4464 .size-mixin (e (' ' ));
149169 margin-right : var (--tv-Tag-slot-icon-margin-right );
150170 fill : currentColor ;
151171 }
152-
153- & .@{tag-prefix-cls} --only-icon.@{tag-prefix-cls} --only-icon.@{tag-prefix-cls} --only-icon {
154- padding : var (--tv-Tag-only-icon-padding );
155-
156- svg {
157- font-size : var (--tv-Tag-only-icon-font-size );
158- margin-right : 0 ; // 此时不需要右边距了
159- }
160- }
161172}
Original file line number Diff line number Diff line change 2424 --tv-Tag-padding-y-mini : 0.5px ;
2525 // 超小标签圆角
2626 --tv-Tag-border-radius-mini : var (--tv-border-radius-xs );
27+ // 标签在仅图标模式时,图标的大小
28+ --tv-Tag-only-icon-font-size-mini : 12px ;
29+ // 标签在仅图标模式时,标签的内边距
30+ --tv-Tag-only-icon-padding-mini : 2px ;
31+
2732 // 小型标签字号
2833 --tv-Tag-font-size-small : var (--tv-font-size-sm );
2934 // 小型标签水平间距
3237 --tv-Tag-padding-y-small : 0 ;
3338 // 小型标签圆角
3439 --tv-Tag-border-radius-small : var (--tv-border-radius-xs );
40+ // 标签在仅图标模式时,图标的大小
41+ --tv-Tag-only-icon-font-size-small : 14px ;
42+ // 标签在仅图标模式时,标签的内边距
43+ --tv-Tag-only-icon-padding-small : 2px ;
44+
3545 // 默认标签字号
3646 --tv-Tag-font-size : var (--tv-font-size-md );
3747 // 默认标签水平间距
4050 --tv-Tag-padding-y : 0.5px ;
4151 // 默认标签圆角
4252 --tv-Tag-border-radius : var (--tv-border-radius-sm );
53+ // 标签在仅图标模式时,图标的大小
54+ --tv-Tag-only-icon-font-size : 16px ;
55+ // 标签在仅图标模式时,标签的内边距
56+ --tv-Tag-only-icon-padding : 3px ;
57+
4358 // 中等标签字号
4459 --tv-Tag-font-size-medium : var (--tv-font-size-md );
4560 // 中等标签水平间距
4863 --tv-Tag-padding-y-medium : 4.5px ;
4964 // 中等标签圆角
5065 --tv-Tag-border-radius-medium : var (--tv-border-radius-md );
66+ // 标签在仅图标模式时,图标的大小
67+ --tv-Tag-only-icon-font-size-medium : 20px ;
68+ // 标签在仅图标模式时,标签的内边距
69+ --tv-Tag-only-icon-padding-medium : 5px ;
5170
5271 // ------------------------------------------------------- 颜色 场景:(1、考虑border,虽然cloud design没有,但适配其它肯定有border的) ----
5372
201220 // ------------------------------------------------------- 其它 场景:-----------------------------------
202221 // 标签插槽有前置图标时,图标的右间距
203222 --tv-Tag-slot-icon-margin-right : var (--tv-space-sm );
204- // 标签在仅图标模式时,图标的大小
205- --tv-Tag-only-icon-font-size : var (--tv-font-size-sm );
206- // 标签在仅图标模式时,标签的内边距
207- --tv-Tag-only-icon-padding : 3px ;
208223}
You can’t perform that action at this time.
0 commit comments