New stripedRows for Orderlist

pull/2157/head
Tuğçe Küçükoğlu 2022-02-14 10:56:41 +03:00 committed by Tuğçe Küçükoğlu
parent cc53fefbc9
commit 838be3bb87
4 changed files with 21 additions and 2 deletions

View File

@ -61,6 +61,10 @@ export interface OrderListProps {
* Default value is '960px'.
*/
breakpoint?: string | undefined;
/**
* Whether to displays rows with alternating colors.
*/
stripedRows?: boolean | undefined;
}
export interface OrderListSlots {

View File

@ -1,5 +1,5 @@
<template>
<div class="p-orderlist p-component">
<div :class="containerClass">
<div class="p-orderlist-controls">
<slot name="controlsstart"></slot>
<OLButton type="button" icon="pi pi-angle-up" @click="moveUp"></OLButton>
@ -61,6 +61,10 @@ export default {
breakpoint: {
type: String,
default: '960px'
},
stripedRows: {
type: Boolean,
default: false
}
},
itemTouched: false,
@ -352,6 +356,11 @@ export default {
}
},
computed: {
containerClass() {
return ['p-orderlist p-component', {
'p-orderlist-striped': this.stripedRows
}];
},
attributeSelector() {
return UniqueComponentId();
}

View File

@ -10,7 +10,7 @@
<div class="content-section implementation">
<div class="card">
<OrderList v-model="products" listStyle="height:auto" dataKey="id">
<OrderList v-model="products" listStyle="height:auto" dataKey="id" stripedRows>
<template #header>
List of Products
</template>

View File

@ -125,6 +125,12 @@ import OrderList from 'primevue/orderlist';
<td>string</td>
<td>960px</td>
<td>The breakpoint to define the maximum width boundary when responsiveness is enabled.</td>
</tr>
<tr>
<td>stripedRows</td>
<td>boolean</td>
<td>false</td>
<td>Whether to displays rows with alternating colors.</td>
</tr>
</tbody>
</table>