Refactor #3965 - For AvatarGroup
parent
ac398b1c49
commit
4ae07e300b
|
@ -38,6 +38,11 @@ export interface AvatarGroupProps {
|
||||||
* @type {AvatarGroupPassThroughOptions}
|
* @type {AvatarGroupPassThroughOptions}
|
||||||
*/
|
*/
|
||||||
pt?: AvatarGroupPassThroughOptions;
|
pt?: AvatarGroupPassThroughOptions;
|
||||||
|
/**
|
||||||
|
* When enabled, it removes component related styles in the core.
|
||||||
|
* @defaultValue false
|
||||||
|
*/
|
||||||
|
unstyled?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,25 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="p-avatar-group p-component" v-bind="ptm('root')">
|
<div :class="cx('root')" v-bind="ptm('root')">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import BaseComponent from 'primevue/basecomponent';
|
import BaseAvatarGroup from './BaseAvatarGroup.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AvatarGroup',
|
name: 'AvatarGroup',
|
||||||
extends: BaseComponent
|
extends: BaseAvatarGroup
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
|
||||||
.p-avatar-group .p-avatar + .p-avatar {
|
|
||||||
margin-left: -1rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.p-avatar-group {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
<script>
|
||||||
|
import BaseComponent from 'primevue/basecomponent';
|
||||||
|
import { useStyle } from 'primevue/usestyle';
|
||||||
|
|
||||||
|
const styles = `
|
||||||
|
.p-avatar-group .p-avatar + .p-avatar {
|
||||||
|
margin-left: -1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-avatar-group {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
|
const classes = {
|
||||||
|
root: 'p-avatar-group p-component'
|
||||||
|
};
|
||||||
|
|
||||||
|
const { load: loadStyle } = useStyle(styles, { id: 'primevue_avatargroup_style', manual: true });
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'BaseAvatarGroup',
|
||||||
|
extends: BaseComponent,
|
||||||
|
css: {
|
||||||
|
classes
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
isUnstyled: {
|
||||||
|
immediate: true,
|
||||||
|
handler(newValue) {
|
||||||
|
!newValue && loadStyle();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue