mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #4929 - Add parent param to all pt method options
This commit is contained in:
parent
1a4bba8107
commit
eb00b8ee23
104 changed files with 399 additions and 158 deletions
5
components/lib/avatar/Avatar.d.ts
vendored
5
components/lib/avatar/Avatar.d.ts
vendored
|
@ -7,7 +7,6 @@
|
|||
* @module avatar
|
||||
*/
|
||||
import { VNode } from 'vue';
|
||||
import { AvatarGroupPassThroughOptions } from '../avatargroup';
|
||||
import { ComponentHooks } from '../basecomponent';
|
||||
import { PassThroughOptions } from '../passthrough';
|
||||
import { ClassComponent, GlobalComponentConstructor, PassThrough } from '../ts-helpers';
|
||||
|
@ -27,9 +26,9 @@ export interface AvatarPassThroughMethodOptions {
|
|||
*/
|
||||
props: AvatarProps;
|
||||
/**
|
||||
* Defines parent instance.
|
||||
* Defines parent options.
|
||||
*/
|
||||
parent: AvatarGroupPassThroughOptions;
|
||||
parent: any;
|
||||
/**
|
||||
* Defines passthrough(pt) options in global config.
|
||||
*/
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<template>
|
||||
<div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="getPTOptions('root')" data-pc-name="avatar">
|
||||
<div :class="cx('root')" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" v-bind="ptm('root')" data-pc-name="avatar">
|
||||
<slot>
|
||||
<span v-if="label" :class="cx('label')" v-bind="getPTOptions('label')">{{ label }}</span>
|
||||
<span v-if="label" :class="cx('label')" v-bind="ptm('label')">{{ label }}</span>
|
||||
<component v-else-if="$slots.icon" :is="$slots.icon" :class="cx('icon')" />
|
||||
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="getPTOptions('icon')" />
|
||||
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="getPTOptions('image')" />
|
||||
<span v-else-if="icon" :class="[cx('icon'), icon]" v-bind="ptm('icon')" />
|
||||
<img v-else-if="image" :src="image" :alt="ariaLabel" @error="onError" v-bind="ptm('image')" />
|
||||
</slot>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -19,13 +19,6 @@ export default {
|
|||
methods: {
|
||||
onError(event) {
|
||||
this.$emit('error', event);
|
||||
},
|
||||
getPTOptions(key) {
|
||||
return this.ptm(key, {
|
||||
parent: {
|
||||
instance: this.$parent
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue