Browse Source

增加选填

zhangchao 4 years ago
parent
commit
95aceb0b42
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/RichTextEditor.js

+ 5
- 4
src/RichTextEditor.js View File

@@ -200,7 +200,7 @@ export default class RichTextEditor extends Component {
200 200
   }
201 201
 
202 202
   _renderLinkModal() {
203
-    const {linkOption} = this.props;
203
+    const {linkOption,optionalText} = this.props;
204 204
     return (
205 205
         <Modal
206 206
             animationType={"fade"}
@@ -213,9 +213,10 @@ export default class RichTextEditor extends Component {
213 213
               <Text style={styles.inputTitle}>{linkOption.titleText}</Text>
214 214
               <View style={styles.inputWrapper}>
215 215
                 <TextInput
216
-                    style={styles.input}
217
-                    onChangeText={(text) => this.setState({linkTitle: text})}
218
-                    value={this.state.linkTitle}
216
+                  style={styles.input}
217
+                  onChangeText={(text) => this.setState({linkTitle: text})}
218
+                  value={this.state.linkTitle}
219
+                  placeholder={optionalText}
219 220
                 />
220 221
               </View>
221 222
               <Text style={[styles.inputTitle ,{marginTop: 10}]}>{linkOption.urlText}</Text>