Преглед изворни кода

chore: fix only use IamgePreview will lost css in webpack project (#1175)

* chore: fix only use IamgePreview will lost css in webpack project

* docs: update changelog
pointhalo пре 3 година
родитељ
комит
44414c2ccb

+ 3 - 2
content/start/changelog/index-en-US.md

@@ -16,9 +16,10 @@ Version:Major.Minor.Patch (follow the **Semver** specification)
 
 ---
 
-#### 🎉 2.20.4 (2022-10-08)
+
+#### 🎉 2.20.7 (2022-10-10)
 - 【Fix】
-  - Fix scss not imported in ImagePreview
+  - Fix the problem that the style is lost when only ImagePreview is introduced and used alone, and the Image component is not introduced[#1175](https://github.com/DouyinFE/semi-design/pull/1175)
 
 #### 🎉 2.20.3 (2022-09-28)
 - 【Fix】

+ 2 - 2
content/start/changelog/index.md

@@ -16,9 +16,9 @@ Semi 版本号遵循 **Semver** 规范(主版本号-次版本号-修订版本
 
 ---
 
-#### 🎉 2.20.4 (2022-10-08)
+#### 🎉 2.20.7 (2022-10-10)
 - 【Fix】
-  - 修复 scss 在 ImagePreview 中未导入问题
+  - 修复只引入 ImagePreview 单独使用,未引入 Image 组件时样式丢失的问题 [#1175](https://github.com/DouyinFE/semi-design/pull/1175)
 
 #### 🎉 2.20.3 (2022-09-28)
 - 【Fix】

+ 1 - 0
packages/semi-ui/image/image.tsx

@@ -14,6 +14,7 @@ import LocaleConsumer from "../locale/localeConsumer";
 import { Locale } from "../locale/interface";
 import { isObject } from "lodash";
 import Skeleton from "../skeleton";
+import "@douyinfe/semi-foundation/image/image.scss";
 
 const prefixCls = cssClasses.PREFIX;
 

+ 3 - 2
packages/semi-ui/image/preview.tsx

@@ -8,6 +8,7 @@ import PreviewFoundation from "@douyinfe/semi-foundation/image/previewFoundation
 import { getUuidShort } from "@douyinfe/semi-foundation/utils/uuid";
 import { cssClasses } from "@douyinfe/semi-foundation/image/constants";
 import { isObject } from "lodash";
+import "@douyinfe/semi-foundation/image/image.scss";
 
 const prefixCls = cssClasses.PREFIX;
 
@@ -28,10 +29,10 @@ export default class Preview extends BaseComponent<PreviewProps, PreviewState> {
         closeOnEsc: PropTypes.bool,
         prevTip: PropTypes.string,
         nextTip: PropTypes.string,
-        zoomInTip:PropTypes.string,
+        zoomInTip: PropTypes.string,
         zoomOutTip: PropTypes.string,
         downloadTip: PropTypes.string,
-        adaptiveTip:PropTypes.string,
+        adaptiveTip: PropTypes.string,
         originTip: PropTypes.string,
         lazyLoad: PropTypes.bool,
         lazyLoadMargin: PropTypes.string,