File tree Expand file tree Collapse file tree 5 files changed +21
-52
lines changed
src/uni_modules/wot-design-uni Expand file tree Collapse file tree 5 files changed +21
-52
lines changed Original file line number Diff line number Diff line change 3636 // #vue组件中html代码格式化样式
3737 }
3838 },
39- "typescript.tsdk" : " node_modules\\ typescript\\ lib" ,
39+ "typescript.tsdk" : " node_modules/ typescript/ lib" ,
4040 "i18n-ally.localesPaths" : [
4141 " src/uni_modules/wot-design-uni/locale" ,
4242 " src/uni_modules/wot-design-uni/locale/lang"
Original file line number Diff line number Diff line change 11@import ' ../common/abstracts/variable' ;
22@import ' ../common/abstracts/mixin' ;
33
4- @mixin text-type-style ($normalColor ) {
5- color : $normalColor ;
64
7- & .is-bold {
8- font-weight : bold ;
9- }
10-
11- & .is-lines-1 ,
12- & .is-lines-2 ,
13- & .is-lines-3 ,
14- & .is-lines-4 ,
15- & .is-lines-5 {
16- display : -webkit-box !important ;
17- overflow : hidden ;
18- text-overflow : ellipsis ;
19- word-break : break-all ;
20- -webkit-box-orient : vertical !important ;
21- }
22-
23- & .is-lines-1 {
24- @include multiEllipsis (1 );
25- }
26-
27- & .is-lines-2 {
28- line-clamp : 2 ;
29- @include multiEllipsis (2 );
30-
31- }
32-
33- & .is-lines-3 {
34- @include multiEllipsis (3 );
35-
36- }
375
38- & .is-lines-4 {
39- @include multiEllipsis (4 );
6+ @include b (text ) {
407
8+ @include when (bold ) {
9+ font-weight : bold ;
4110 }
4211
43- & .is-lines-5 {
44- @include multiEllipsis (5 );
45-
12+ @for $i from 1 through 5 {
13+ & .is-lines-#{$i } {
14+ @include multiEllipsis ($i );
15+ }
4616 }
47- }
4817
49- @include b (text ) {
5018 @include when (default ) {
51- @include text-type-style ( $-text-info-color ) ;
19+ color : $-text-info-color ;
5220 }
5321
5422 @include when (primary) {
55- @include text-type-style ( $-text-primary-color ) ;
23+ color : $-text-primary-color ;
5624 }
5725
5826 @include when (error) {
59- @include text-type-style ( $-text-error-color ) ;
27+ color : $-text-error-color ;
6028 }
6129
6230 @include when (warning) {
63- @include text-type-style ( $-text-warning-color ) ;
31+ color : $-text-warning-color ;
6432 }
6533
6634 @include when (success) {
67- @include text-type-style ( $-text-success-color ) ;
35+ color : $-text-success-color ;
6836 }
6937}
Original file line number Diff line number Diff line change 11import type { ExtractPropTypes } from 'vue'
22import { baseProps , makeBooleanProp , makeStringProp } from '../common/props'
33
4- export type TextType = 'default' | 'primary' | 'success' | 'warning' | 'danger '
4+ export type TextType = 'default' | 'primary' | 'success' | 'warning' | 'error '
55
66export const textProps = {
77 ...baseProps ,
@@ -68,13 +68,13 @@ export const textProps = {
6868 * 类型:string
6969 * 默认值:''
7070 */
71- prefix : makeStringProp ( '' ) ,
71+ prefix : String ,
7272 /**
7373 * 后置插槽
7474 * 类型:string
7575 * 默认值:''
7676 */
77- suffix : makeStringProp ( '' ) ,
77+ suffix : String ,
7878 /**
7979 * 文本显示的行数,如果设置,超出此行数,将会显示省略号。最大值为5。
8080 */
Original file line number Diff line number Diff line change 11<template >
22 <text @click =" handleClick" :class =" rootClass" :style =" rootStyle" >
3- <slot name =" prefix" >{{ props. prefix }}</slot >
3+ <slot v-if = " $slots.prefix || prefix " name =" prefix" >{{ prefix }}</slot >
44 <text >{{ formattedText }}</text >
5- <slot name =" suffix" >{{ props. suffix }}</slot >
5+ <slot v-if = " $slots.suffix || suffix " name =" suffix" >{{ suffix }}</slot >
66 </text >
77</template >
88
Original file line number Diff line number Diff line change 11/*
22 * @Author : weisheng
33 * @Date : 2023-09-25 17:28:12
4- * @LastEditTime : 2024-07-05 14:37 :28
4+ * @LastEditTime : 2024-07-31 23:10 :28
55 * @LastEditors : weisheng
66 * @Description :
7- * @FilePath : \ wot-design-uni\ src\ uni_modules\ wot-design-uni\ global.d.ts
7+ * @FilePath : / wot-design-uni/ src/ uni_modules/ wot-design-uni/ global.d.ts
88 * 记得注释
99 */
1010import '@vue/runtime-core'
@@ -100,6 +100,7 @@ declare module '@vue/runtime-core' {
100100 WdSkeleton : typeof import ( './components/wd-skeleton/wd-skeleton.vue' ) [ 'default' ]
101101 WdIndexBar : typeof import ( './components/wd-index-bar/wd-index-bar.vue' ) [ 'default' ]
102102 WdIndexAnchor : typeof import ( './components/wd-index-anchor/wd-index-anchor.vue' ) [ 'default' ]
103+ WdText : typeof import ( './components/wd-text/wd-text.vue' ) [ 'default' ]
103104 }
104105}
105106
You can’t perform that action at this time.
0 commit comments