From 711ac6c4a087516788e71cf8b092259dd88e12a8 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Wed, 16 Aug 2023 10:43:10 +0800
Subject: [PATCH] feat(component): text \n
---
pages/component/text/text-props.test.js | 12 ++
pages/component/text/text-props.uvue | 206 +++++++++++++-----------
2 files changed, 120 insertions(+), 98 deletions(-)
create mode 100644 pages/component/text/text-props.test.js
diff --git a/pages/component/text/text-props.test.js b/pages/component/text/text-props.test.js
new file mode 100644
index 00000000..bbe185d2
--- /dev/null
+++ b/pages/component/text/text-props.test.js
@@ -0,0 +1,12 @@
+const PAGE_PATH = '/pages/component/text/text-props'
+
+describe('text-props', () => {
+ beforeAll(async () => {
+ const page = await program.navigateTo(PAGE_PATH)
+ await page.waitFor(1000)
+ })
+ it('screenshot', async () => {
+ const image = await program.screenshot({ fullPage: true })
+ expect(image).toMatchImageSnapshot()
+ })
+})
diff --git a/pages/component/text/text-props.uvue b/pages/component/text/text-props.uvue
index 08f6cb08..691cf291 100644
--- a/pages/component/text/text-props.uvue
+++ b/pages/component/text/text-props.uvue
@@ -1,111 +1,121 @@
-
-
-
-
- text相关属性示例
-
+
+
+
+
+ text相关属性示例
+
-
- 根据宽度自动折行
-
-
- {{multiLineText}}
-
-
-
- \\n换行
-
-
- \n换\n行\n
-
+
+ 根据宽度自动折行
+
+
+ {{ multiLineText }}
+
-
- 截断(clip)
-
-
- {{multiLineText}}
-
-
-
- 截断(ellipsis)
-
-
- {{multiLineText}}
-
+
+ \\n换行
+
+
+ \n 换行
+ \\n 换行
+ \\\n 换行
+ \n 换行 \\n 换行 \\\n 换行 \\\\n 换行 \\\\\n 换行
+
-
- selectable
-
-
- {{singleLineText}}
-
+
+ 截断(clip)
+
+
+ {{
+ multiLineText
+ }}
+
-
- space
- 依次为nbsp ensp emsp效果
-
-
- {{singleLineText}}
- {{singleLineText}}
- {{singleLineText}}
-
+
+ 截断(ellipsis)
+
+
+ {{
+ multiLineText
+ }}
+
-
- decode
- 依次为lt gt amp apos nbsp ensp emsp效果
-
-
- < > & '
- uni-app x,终极跨平台方案
- uni-app x,终极跨平台方案
- uni-app x,终极跨平台方案
-
-
-
- 嵌套
-
-
- 一级节点黑色
- 二级节点红色
- 三级节点不继承二级的颜色
-
- 二级节点大字体
-
-
-
-
+
+ selectable
+
+
+ {{ singleLineText }}
+
+
+
+ space
+ 依次为nbsp ensp emsp效果
+
+
+ {{ singleLineText }}
+ {{ singleLineText }}
+ {{ singleLineText }}
+
+
+
+ decode
+ 依次为lt gt amp apos nbsp ensp emsp效果
+
+
+ < > & '
+ uni-app x,终极跨平台方案
+ uni-app x,终极跨平台方案
+ uni-app x,终极跨平台方案
+
+
+
+ 嵌套
+
+
+ 一级节点黑色
+ 二级节点红色
+ 三级节点不继承二级的颜色
+
+ 二级节点大字体
+
+
+
+
\ No newline at end of file
+.text {
+ font-size: 30rpx;
+ color: #353535;
+ line-height: 54rpx;
+ text-align: center;
+}
+
--
GitLab