Skip to content

Commit

Permalink
修复小程序端图片显示不全
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaoGongBra committed Jun 7, 2022
1 parent a3a5aec commit 8459b18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions components/HtmlView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const Image = ({ style, className, src, containerLayout, onClick }) => {
}, [onClick])

return <TaroImage
style={[{ width: containerLayout.width + (process.env.TARO_ENV === 'rn' ? 0 : 'px') }, style]}
style={{ width: containerLayout.width + (process.env.TARO_ENV === 'rn' ? 0 : 'px'), ...style }}
className={className}
src={src}
mode='widthFix'
Expand All @@ -40,10 +40,11 @@ const Video = ({ style, className, src, controls, containerLayout, children }) =

return isPlay ?
<TaroVideo
style={[{
style={{
width: containerLayout.width + (process.env.TARO_ENV === 'rn' ? 0 : 'px'),
// height: containerLayout.width * 9 / 16 + (process.env.TARO_ENV === 'rn' ? 0 : 'px')
}, style]}
height: containerLayout.width * 9 / 16 + (process.env.TARO_ENV === 'rn' ? 0 : 'px'),
...style
}}
className={className}
controls={!!controls}
src={childSrc || src}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "taro-html-view",
"version": "1.0.4",
"version": "1.0.5",
"description": "支持渲染由富文本编辑器编辑的html文本内容,支持小程序、h5、ReactNative,复杂的内容可能并不能正确渲染",
"main": "index.js",
"author": "[email protected]",
Expand Down

0 comments on commit 8459b18

Please sign in to comment.