ref |> 评论展开收起文字颜色
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
1 changed file
with
5 additions
and
3 deletions
| @@ -3,8 +3,8 @@ import curves from '@ohos.curves'; | @@ -3,8 +3,8 @@ import curves from '@ohos.curves'; | ||
| 3 | import { BusinessError } from '@ohos.base'; | 3 | import { BusinessError } from '@ohos.base'; |
| 4 | import display from '@ohos.display'; | 4 | import display from '@ohos.display'; |
| 5 | 5 | ||
| 6 | -const collapseString = '...展开全文' | ||
| 7 | -const uncollapseString = '...收起' | 6 | +const collapseString = '...展开' |
| 7 | +const uncollapseString = ' 收起' | ||
| 8 | 8 | ||
| 9 | const TestLongText = "超过三行超\n过三行超过\n三行超超过三行\n超过三行超过三行超过三\n行超过" | 9 | const TestLongText = "超过三行超\n过三行超过\n三行超超过三行\n超过三行超过三行超过三\n行超过" |
| 10 | 10 | ||
| @@ -129,7 +129,9 @@ export struct CommentText { | @@ -129,7 +129,9 @@ export struct CommentText { | ||
| 129 | // Stack({ alignContent: Alignment.BottomEnd }) { | 129 | // Stack({ alignContent: Alignment.BottomEnd }) { |
| 130 | Text(this.longMessage) { | 130 | Text(this.longMessage) { |
| 131 | Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) | 131 | Span(this.expandedStates ? this.longMessage : this.maxLineMesssage) |
| 132 | - Span(this.collapseText).onClick(() => { | 132 | + Span(this.collapseText) |
| 133 | + .fontColor("#999999") | ||
| 134 | + .onClick(() => { | ||
| 133 | if (this.collapseText == collapseString) { | 135 | if (this.collapseText == collapseString) { |
| 134 | this.collapseText = uncollapseString; | 136 | this.collapseText = uncollapseString; |
| 135 | this.expandedStates = true; | 137 | this.expandedStates = true; |
-
Please register or login to post a comment