diff --git a/README.md b/README.md
index 58f16547dfd3e5bee2b5d28f3f6747aead1245d0..219b4803fd8fc4c2664de65032955ba649254dca 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')
+ }
}
```
@@ -57,7 +52,7 @@ CloudTest代码测试无异常
## 版本迭代
- v0.0.1-SNAPSHOT
-# License
+## License
```
Copyright 2016 zhonghanwen
diff --git a/entry/src/main/js/default/pages/index/index.hml b/entry/src/main/js/default/pages/index/index.hml
index 3b1e5953876508ac1a526273fd8af3e636e8e48b..1a8239edc1bd1973ddc2e327ff36d9b8f3275af9 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') }}
-
+