Skip to content

Commit 6938ed8

Browse files
committed
chore(doc,example): add textDecoration intro
1 parent dd9d80a commit 6938ed8

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

docs/style/appearance.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,50 @@
154154
| ------ | -------- | --- |
155155
| number | 否 | All
156156

157+
# textDecoration
158+
159+
`textDecorationLine`
160+
161+
| 类型 | 必需 | 平台 |
162+
| ------ | -------- | --------|
163+
| enum('underline', 'line-through', 'none') || 双平台支持 |
164+
165+
# textDecorationColor
166+
167+
[Hippy-React 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-react-demo/src/components/Text/index.jsx)
168+
169+
[Hippy-Vue 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-vue-demo/src/components/demos/demo-p.vue)
170+
171+
文本的修饰线颜色
172+
173+
| 类型 | 必需 | 平台 |
174+
| ------ | -------- | --------|
175+
| [color](style/color.md) || iOS |
176+
177+
# textDecorationLine
178+
179+
[Hippy-React 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-react-demo/src/components/Text/index.jsx)
180+
181+
[Hippy-Vue 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-vue-demo/src/components/demos/demo-p.vue)
182+
183+
文本的修饰线类型
184+
185+
| 类型 | 必需 | 平台 |
186+
| ------ | -------- | --------|
187+
| enum('underline', 'line-through', 'none') || 双平台支持 |
188+
189+
# textDecorationStyle
190+
191+
[Hippy-React 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-react-demo/src/components/Text/index.jsx)
192+
193+
[Hippy-Vue 范例](https://github.com/Tencent/Hippy/blob/master/examples/hippy-vue-demo/src/components/demos/demo-p.vue)
194+
195+
文本的修饰线样式
196+
197+
| 类型 | 必需 | 平台 |
198+
| ------ | -------- | --------|
199+
| enum('dotted', 'dashed', 'solid') || iOS |
200+
157201
# textShadowColor
158202

159203
> 最低支持版本 2.10.0

examples/hippy-react-demo/src/components/Text/index.jsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,15 @@ export default class TextExpo extends React.Component {
160160
lines just two lines just two lines just two lines just two lines just two lines
161161
</Text>
162162
</View>
163+
{renderTitle('textDecoration')}
164+
<View style={styles.itemContent}>
165+
<Text numberOfLines={1} style={[styles.normalText, { textDecorationLine: 'underline', textDecorationStyle: 'dotted' }]}>
166+
underline
167+
</Text>
168+
<Text numberOfLines={1} style={[styles.normalText, { textDecorationLine: 'line-through', textDecorationColor: 'red' }]}>
169+
line-through
170+
</Text>
171+
</View>
163172
{renderTitle('Nest Text')}
164173
<View style={styles.itemContent}>
165174
<Text numberOfLines={3}>

examples/hippy-vue-demo/src/components/demos/demo-p.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,12 @@ export default {
116116
117117
.p-demo .p-demo-4 {
118118
text-decoration-line: underline;
119-
text-decoration: underline;
119+
text-decoration-style: dotted;
120120
}
121121
122122
.p-demo .p-demo-5 {
123-
text-decoration: line-through;
123+
text-decoration-line: line-through;
124+
text-decoration-color: red;
124125
}
125126
126127
.p-demo .p-demo-6 {

0 commit comments

Comments
 (0)