将变量传递到图像组件-React Native

时间:2018-09-08 17:57:30

标签: react-native react-native-image

如何将{64}字符串markerPass.Logo__c传递到图像组件中?

<Image source={{uri: 'data:image/png;base64,' + {markerPass.Logo__c} + '\''}}/>

1 个答案:

答案 0 :(得分:2)

您可以通过反引号``

使用模板文字
<Image source={{uri: `data:image/png;base64,${markerPass.Logo__c}\'`}}/>