From 8e24aae96e226602987ed708ec1e03cf0d1fce93 Mon Sep 17 00:00:00 2001
From: 258767-shengyu <1qaz2wsx>
Date: Tue, 15 Jun 2021 10:23:02 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 37 ++++++++-----------
.../src/main/js/default/pages/index/index.hml | 2 +-
2 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/README.md b/README.md
index 58f1654..6059a16 100644
--- a/README.md
+++ b/README.md
@@ -12,32 +12,27 @@
## 使用说明
```
- 1.index.hml中引入组件,从index.js中传入content和colorList
+ 1.新建common/comp文件夹,将colorText.css,colorText.hml和colorText.js三个文件拷贝进去
+
+ 2.index.hml中引入组件,从index.js中传入content
-
+
-
- 2.index.js中传入需要设置的段落,通过this.colorList.push({txt:'you',color:'#00CED1'})来给指定文字设置指定颜色
+ 3.index.js中传入需要设置的段落,通过this.$child("colorText").findAndSetStrColor()来给指定文字设置指定颜色
export default {
- data: {
- /*展示文本*/
- content: `Is your job doing harm to your health? If you are
- like a lot of American workers today, you experience a significant amount
- of stress in work. 你好`,
-
- /*保存需要设置的文字和颜色*/
- colorList:[],
- },
- onInit() {
- //给指定文字设置指定颜色
- this.colorList.push({txt:'you',color:'#00CED1'})
- this.colorList.push({txt:'workers',color:'#7E3D76'})
- this.colorList.push({txt:'你好',color:'#FF0000'})
- this.colorList.push({txt:'doing',color:'#D9B300'})
- this.colorList.push({txt:'experience',color:'#3CB371'})
- },
+ data: {
+ /*展示文本*/
+ content: `You can get 500 credits after connect and share the WIFI`,
+ },
+ onShow(){
+ /*调用子组件设置颜色方法*/
+ this.$child("colorText").findAndSetStrColor('You','#ff8000')
+ this.$child("colorText").findAndSetStrColor('can','#008888')
+ this.$child("colorText").findAndSetStrColor('500','#98FB98')
+ this.$child("colorText").findAndSetStrColor('WIFI','#FF0000')
+ }
}
```
diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml
index 3b1e595..1a8239e 100644
--- a/entry/src/main/js/default/pages/index/index.hml
+++ b/entry/src/main/js/default/pages/index/index.hml
@@ -1,5 +1,5 @@
{{ $t('strings.app_name') }}
-
+
--
Gitee
From df331a481f47c8aac1850592d6b16ef397214a47 Mon Sep 17 00:00:00 2001
From: 258767-shengyu <1qaz2wsx>
Date: Tue, 15 Jun 2021 14:51:14 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9readme?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 6059a16..219b480 100644
--- a/README.md
+++ b/README.md
@@ -52,7 +52,7 @@ CloudTest代码测试无异常
## 版本迭代
- v0.0.1-SNAPSHOT
-# License
+## License
```
Copyright 2016 zhonghanwen
--
Gitee