@@ -16,14 +16,15 @@ import VariableTextInputView, {
1616export const App = ( ) => {
1717 const inPutRef = React . createRef < IATTextViewBase > ( ) ;
1818 const onChangeText = ( text : string ) => {
19+ console . log ( '输入框数据====>' , text ) ;
1920 const triggerRegEx = / ( { ( [ ^ { ^ } ] * ) } \[ ( [ ^ [ ] * ) ] \( ( [ ^ ( ^ ) ] * ) \) ) / gi;
2021 const singleGroupTriggerRegEx = / ( { [ ^ { ^ } ] * } \[ [ ^ [ ] * ] \( [ ^ ( ^ ) ] * \) ) / gi;
2122 const matchStr = text . match ( triggerRegEx ) ;
2223 if ( matchStr !== null ) {
2324 const subStrArr = text . split ( triggerRegEx ) ;
2425 subStrArr . forEach ( ( item ) => {
2526 const arr = item . match ( singleGroupTriggerRegEx ) ;
26- console . log ( '====>' , arr ) ;
27+ console . log ( '==处理后的数据 ==>' , arr ) ;
2728 } ) ;
2829 }
2930 } ;
@@ -42,9 +43,9 @@ export const App = () => {
4243 } ;
4344 const insertMonthons = ( ) => {
4445 inPutRef . current ?. insertMentions ( {
45- tag : '# ' ,
46- name : '测试tag ' ,
47- color : 'red ' ,
46+ tag : '@ ' ,
47+ name : 'James Harden ' ,
48+ color : '#CEDA39 ' ,
4849 id : '123344' ,
4950 type : ITextType . tagText ,
5051 } ) ;
@@ -57,14 +58,24 @@ export const App = () => {
5758 const tagData : IInserTextAttachmentItem = {
5859 tag : '#' ,
5960 name : '测试tag' ,
60- color : 'red ' ,
61+ color : '#CEDA39 ' ,
6162 id : '123344' ,
6263 type : ITextType . tagText ,
6364 } ;
6465 inPutRef . current ?. changeAttributedText ( [
6566 { type : 0 , text : '普通字符' } ,
6667 { type : 1 , ...emojiData } ,
6768 tagData ,
69+ { type : 0 , text : '普通字符' } ,
70+ tagData ,
71+ { type : 1 , ...emojiData } ,
72+ { type : 0 , text : '普通字符' } ,
73+ tagData ,
74+ { type : 0 , text : '普通字符' } ,
75+ tagData ,
76+ { type : 1 , ...emojiData } ,
77+ { type : 1 , ...emojiData } ,
78+ { type : 1 , ...emojiData } ,
6879 ] ) ;
6980 } ;
7081 const focus = ( ) => {
@@ -120,7 +131,7 @@ const styles = StyleSheet.create({
120131 justifyContent : 'center' ,
121132 } ,
122133 box : {
123- backgroundColor : 'blue ' ,
134+ backgroundColor : '#000 ' ,
124135 color : '#fff' ,
125136 fontSize : 14 ,
126137 width : '100%' ,
0 commit comments