Skip to content

Commit 0f7b680

Browse files
committed
feat: update demo
1 parent b92badc commit 0f7b680

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

docs/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#### 2025.4.20
1+
#### 2025.4.21
22
1. `A` 新增文本换行相关特性:
33
- whiteSpace:控制空白字符和换行的处理;
44
- wordBreak:控制单词内的断行规则;

packages/devtools/src/demos/text.vue

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { defineComponent } from "vue";
33
import { template } from "dot";
44
5-
let tpl2 = `
5+
let tpl = `
66
<scrollview id="container" scrollY = "true">
77
<text class="text lineHeightText" value="文本可以指定行高实现垂直居中"></text>
88
@@ -20,8 +20,6 @@ let tpl2 = `
2020
2121
<text class="text normalWrap" value="设置了文本宽度,文本会根据宽度自动换行,这在页面宽度有限的场景下非常有用,比如在展示用户昵称的时候,用户昵称可能是很长的"></text>
2222
23-
<text class="text normalWrap" value="😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊😊"></text>
24-
2523
<text class="text textOverflowText" value="很长很长很长的文本可以设置截断方式,比如这段文字超出屏幕,但是会省略号展示"></text>
2624
2725
<text class="text textMiddle" value="设置了文本宽度,文本会根据宽度自动换行,有时候换行的文本也想要垂直居中,可以通过设置高度和verticalAlign来实现"></text>
@@ -36,13 +34,6 @@ let tpl2 = `
3634
</scrollview>
3735
`;
3836
39-
40-
let tpl = `
41-
<scrollview id="container" scrollY = "true">
42-
<text id="test" class="text normalWrap" value="设置了文本宽度,文本会根据宽度自动换行,这在页面宽度有限的场景下非常有用,比如在展示用户昵称的时候,用户昵称可能是很长的"></text>
43-
</scrollview>
44-
`;
45-
4637
let style = {
4738
container: {
4839
width: 800,
@@ -102,10 +93,6 @@ let style = {
10293
},
10394
textBreakAll: {
10495
wordBreak: 'break-all',
105-
},
106-
normalWrap: {
107-
whiteSpace: 'pre-wrap',
108-
width: 100
10996
}
11097
};
11198
@@ -144,15 +131,6 @@ export default defineComponent({
144131
text.style.backgroundColor = '#f3f3f3'
145132
}
146133
})
147-
148-
const test = Layout.getElementById('test');
149-
test.value = `这是很长的 文字很长很长
150-
3
151-
152-
4
153-
154-
5
155-
6`
156134
},
157135
},
158136
});

0 commit comments

Comments
 (0)