Skip to content

Commit 2c7008d

Browse files
committed
fix: image width & height not work
1 parent 49d4b31 commit 2c7008d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/vc-image/src/Image.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ImgHTMLAttributes, CSSProperties, PropType } from 'vue';
1+
import type { CSSProperties, PropType } from 'vue';
22
import { ref, watch, defineComponent, computed, onMounted, onUnmounted } from 'vue';
33
import isNumber from 'lodash-es/isNumber';
44
import cn from '../../_util/classNames';
@@ -203,8 +203,6 @@ const ImageInternal = defineComponent({
203203
placeholder,
204204
wrapperStyle,
205205
rootClassName,
206-
} = props;
207-
const {
208206
width,
209207
height,
210208
crossorigin,
@@ -215,7 +213,7 @@ const ImageInternal = defineComponent({
215213
usemap,
216214
class: cls,
217215
style,
218-
} = attrs as ImgHTMLAttributes;
216+
} = { ...props, ...attrs } as any;
219217
const { icons, maskClassName, ...dialogProps } = preview.value;
220218

221219
const wrappperClass = cn(prefixCls, wrapperClassName, rootClassName, {

0 commit comments

Comments
 (0)