Skip to content

Commit

Permalink
feat(VImg): add absolute prop
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed May 29, 2024
1 parent 14a2e8c commit f842cd9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/vuetify/src/components/VImg/VImg.sass
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
--v-theme-overlay-multiplier: 3
z-index: 0

&.v-img--absolute
height: 100%
left: 0
overflow: hidden
position: absolute
top: 0
width: 100%
z-index: -1

&--booting .v-responsive__sizer
transition: none

Expand Down
6 changes: 5 additions & 1 deletion packages/vuetify/src/components/VImg/VImg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export type VImgSlots = {
}

export const makeVImgProps = propsFactory({
absolute: Boolean,
alt: String,
cover: Boolean,
color: String,
Expand Down Expand Up @@ -351,7 +352,10 @@ export const VImg = genericComponent<VImgSlots>()({
<VResponsive
class={[
'v-img',
{ 'v-img--booting': !isBooted.value },
{
'v-img--absolute': props.absolute,
'v-img--booting': !isBooted.value,
},
backgroundColorClasses.value,
roundedClasses.value,
props.class,
Expand Down

0 comments on commit f842cd9

Please sign in to comment.