Skip to content

Commit

Permalink
Remove VaImage contain prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ilearnjs committed Jun 22, 2023
1 parent ecb718f commit 789d745
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default defineApiDescription({
lazy: "Enables lazy load for the image.",
draggable: "Proxies the `draggable` attribute to the image [MDN](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/draggable)[[target=_blank]].",
placeholderSrc: "`src` value for the placeholder image (can be replaced with `placeholder` slot).",
contain: "The image is scaled to maintain its aspect ratio while fitting within the element's content box.",
maxWidth: "Maximal image's width"
},
events: {
Expand Down
12 changes: 1 addition & 11 deletions packages/ui/src/components/va-image/VaImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ import { useNativeImgAttributes, useNativeImgAttributesProps } from './hooks/use
import {
useComponentPresetProp,
useIsMounted,
useDeprecated,
useIntersectionObserver,
useGlobalConfig,
} from '../../composables'
Expand Down Expand Up @@ -120,14 +119,9 @@ export default defineComponent({
},
lazy: { type: Boolean, default: false },
placeholderSrc: { type: String, default: '' },
// TODO: delete in 1.7.0
contain: { type: Boolean, default: false },
},
setup (props, { emit, slots }) {
// TODO: delete in 1.7.0
useDeprecated(['contain'])
const root = ref<HTMLElement>()
const image = ref<HTMLImageElement>()
Expand Down Expand Up @@ -236,11 +230,7 @@ export default defineComponent({
const hasFallbackGlobalConfig = computed(() => checkObjectNonEmptyValues(useGlobalConfig()?.globalConfig?.value?.components?.VaFallback))
const isAnyFallbackPassed = computed(() => checkObjectNonEmptyValues(fallbackProps.value) || hasFallbackGlobalConfig.value)
// TODO: refactor (just v-bind fit prop to CSS) in 1.7.0
const fitComputed = computed(() => {
if (props.contain) { return 'contain' }
return props.fit
})
const fitComputed = computed(() => props.fit)
return {
fitComputed,
Expand Down

0 comments on commit 789d745

Please sign in to comment.