mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #3965 - Refactor on Media components
This commit is contained in:
parent
1774b2b8e4
commit
0a1b7e3b15
3 changed files with 102 additions and 139 deletions
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<span :class="cx('root')" :style="style" v-bind="ptm('root')">
|
||||
<slot name="image" :class="imageClass" :style="imageStyle" :onError="onError">
|
||||
<img :style="imageStyle" :class="cx('image')" @error="onError" v-bind="{ ...$attrs, ...ptm('image') }" />
|
||||
<span :class="[cx('root'), containerClass]" :style="style" v-bind="ptm('root')">
|
||||
<slot name="image" :onError="onError">
|
||||
<img :style="imageStyle" :class="[cx('image'), imageClass]" @error="onError" v-bind="{ ...$attrs, ...ptm('image') }" />
|
||||
</slot>
|
||||
<button v-if="preview" ref="previewButton" :class="cx('button')" @click="onImageClick" v-bind="{ ...previewButtonProps, ...ptm('button') }">
|
||||
<slot name="indicatoricon">
|
||||
|
@ -183,13 +183,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
containerClass() {
|
||||
return [
|
||||
'p-image p-component',
|
||||
this.class,
|
||||
{
|
||||
'p-image-preview-container': this.preview
|
||||
}
|
||||
];
|
||||
return this.class;
|
||||
},
|
||||
rotateClass() {
|
||||
return 'p-image-preview-rotate-' + this.rotate;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue