Refactor #3832 Refactor #3833 - For VirtualScroller

pull/3853/head
Tuğçe Küçükoğlu 2023-04-07 09:50:09 +03:00
parent 20726d35e1
commit 8a1a8e8214
3 changed files with 18 additions and 4 deletions

View File

@ -153,15 +153,19 @@ const VirtualScrollerEvents = [
const VirtualScrollerSlots = [
{
name: 'item',
description: 'Content for the item'
description: 'Content for the item.'
},
{
name: 'content',
description: 'Custom content for the component'
description: 'Custom content for the component.'
},
{
name: 'loader',
description: 'Custom content for the loader items'
description: 'Custom content for the loader items.'
},
{
name: 'loadingicon',
description: 'Custom loading icon template.'
}
];

View File

@ -308,6 +308,10 @@ export interface VirtualScrollerSlots {
*/
options: VirtualScrollerLoaderOptions;
}): VNode[];
/**
* Custom loading icon template.
*/
loadingicon(): VNode[];
}
/**

View File

@ -31,7 +31,9 @@
<slot name="loader" :options="getLoaderOptions(index, isBoth() && { numCols: d_numItemsInViewport.cols })"></slot>
</template>
</template>
<i v-else class="p-virtualscroller-loading-icon pi pi-spinner pi-spin"></i>
<slot name="loadingicon">
<SpinnerIcon spin class="p-virtualscroller-loading-icon" />
</slot>
</div>
</div>
</template>
@ -42,6 +44,7 @@
</template>
<script>
import SpinnerIcon from 'primevue/icon/spinner';
import { DomHandler } from 'primevue/utils';
export default {
@ -742,6 +745,9 @@ export default {
return this.columns;
}
},
components: {
SpinnerIcon: SpinnerIcon
}
};
</script>