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'. * Default value is '960px'.
*/ */
breakpoint?: string | undefined; breakpoint?: string | undefined;
/**
* Whether to displays rows with alternating colors.
*/
stripedRows?: boolean | undefined;
} }
export interface OrderListSlots { export interface OrderListSlots {

View File

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

View File

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

View File

@ -125,6 +125,12 @@ import OrderList from 'primevue/orderlist';
<td>string</td> <td>string</td>
<td>960px</td> <td>960px</td>
<td>The breakpoint to define the maximum width boundary when responsiveness is enabled.</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> </tr>
</tbody> </tbody>
</table> </table>