标签:source mes uri font idt body src span const
先将图片转成本地 html,
const imgHtml = `<html>
<body style="width: 100%; height: 100%">
<img style="width: 100%; height: auto; margin: auto" src="${src}" onclick="window.postMessage(‘click‘)">//注:src是传入的图片src
</body>
</html>`;
使用
const imgHtml = this.getImgHtml(this.state.imageUrl);来获取本地的html,注:this.state.imageUrl是传入的图片URI
在使用source={{html: imgHtml}}调用即可
标签:source mes uri font idt body src span const
原文地址:http://www.cnblogs.com/houdzaiw/p/7986108.html