Image: zoomImage aria-label added

pull/4911/head
tugcekucukoglu 2023-11-30 16:57:55 +03:00
parent 7469bc2308
commit fd6799bbe0
1 changed files with 4 additions and 1 deletions

View File

@ -3,7 +3,7 @@
<slot name="image" :onError="onError" :errorCallback="onError"> <slot name="image" :onError="onError" :errorCallback="onError">
<img :style="imageStyle" :class="[cx('image'), imageClass]" @error="onError" v-bind="{ ...$attrs, ...ptm('image') }" /> <img :style="imageStyle" :class="[cx('image'), imageClass]" @error="onError" v-bind="{ ...$attrs, ...ptm('image') }" />
</slot> </slot>
<button v-if="preview" ref="previewButton" type="button" :class="cx('button')" @click="onImageClick" v-bind="{ ...previewButtonProps, ...ptm('button') }"> <button v-if="preview" ref="previewButton" :aria-label="zoomImageAriaLabel" type="button" :class="cx('button')" @click="onImageClick" v-bind="{ ...previewButtonProps, ...ptm('button') }">
<slot name="indicatoricon"> <slot name="indicatoricon">
<component :is="indicatorIcon ? 'i' : 'EyeIcon'" :class="cx('icon')" v-bind="ptm('icon')" /> <component :is="indicatorIcon ? 'i' : 'EyeIcon'" :class="cx('icon')" v-bind="ptm('icon')" />
</slot> </slot>
@ -212,6 +212,9 @@ export default {
zoomOutAriaLabel() { zoomOutAriaLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomOut : undefined; return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomOut : undefined;
}, },
zoomImageAriaLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.zoomImage : undefined;
},
closeAriaLabel() { closeAriaLabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined; return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.close : undefined;
} }