xugenyuan

ref |> 评论展开收起文字颜色

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -3,8 +3,8 @@ import curves from '@ohos.curves';
import { BusinessError } from '@ohos.base';
import display from '@ohos.display';
const collapseString = '...展开全文'
const uncollapseString = '...收起'
const collapseString = '...展开'
const uncollapseString = ' 收起'
const TestLongText = "超过三行超\n过三行超过\n三行超超过三行\n超过三行超过三行超过三\n行超过"
... ... @@ -129,7 +129,9 @@ export struct CommentText {
// Stack({ alignContent: Alignment.BottomEnd }) {
Text(this.longMessage) {
Span(this.expandedStates ? this.longMessage : this.maxLineMesssage)
Span(this.collapseText).onClick(() => {
Span(this.collapseText)
.fontColor("#999999")
.onClick(() => {
if (this.collapseText == collapseString) {
this.collapseText = uncollapseString;
this.expandedStates = true;
... ...