fix(image): preview toolbar error (#4159)

close https://github.com/tusen-ai/naive-ui/issues/4157
This commit is contained in:
Vanilla 2022-12-09 15:35:24 +08:00 committed by GitHub
parent 673f081f30
commit f145984d1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,11 @@
# CHANGELOG
## NEXT_VERSION
### Fixes
- Fix 'n-image' preview toolbar error, close [#4157](https://github.com/tusen-ai/naive-ui/issues/4157).
## 2.34.2
### Fixes

View File

@ -1,5 +1,11 @@
# CHANGELOG
## NEXT_VERSION
### Fixes
- 修复 `n-image` 的预览工具栏报错,关闭 [#4157](https://github.com/tusen-ai/naive-ui/issues/4157)
## 2.34.2
### Fixes

View File

@ -342,7 +342,7 @@ export default defineComponent({
if (!preview) return
const { style } = preview
const controlledStyle = normalizeStyle(
imageContext?.previewedImgPropsRef.value.style
imageContext?.previewedImgPropsRef?.value?.style
)
let controlledStyleString = ''
if (typeof controlledStyle === 'string') {