Add showClear to dropdown to reset filter

pull/104/head
cagataycivici 2019-10-22 09:25:21 +03:00
parent 418a53af41
commit 291d699b9f
1 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@
</Column> </Column>
<Column field="brand" header="Brand" filterMatchMode="equals"> <Column field="brand" header="Brand" filterMatchMode="equals">
<template #filter> <template #filter>
<Dropdown v-model="filters['brand']" :options="brands" optionLabel="brand" optionValue="value" placeholder="Select a Brand" class="p-column-filter"> <Dropdown v-model="filters['brand']" :options="brands" optionLabel="brand" optionValue="value" placeholder="Select a Brand" class="p-column-filter" :showClear="true">
<template #option="slotProps"> <template #option="slotProps">
<div class="p-clearfix p-dropdown-car-option"> <div class="p-clearfix p-dropdown-car-option">
<img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" /> <img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" />
@ -74,7 +74,7 @@
&lt;/Column&gt; &lt;/Column&gt;
&lt;Column field="brand" header="Brand" filterMatchMode="equals"&gt; &lt;Column field="brand" header="Brand" filterMatchMode="equals"&gt;
&lt;template #filter&gt; &lt;template #filter&gt;
&lt;Dropdown v-model="filters['brand']" :options="brands" optionLabel="brand" optionValue="value" placeholder="Select a Brand" class="p-column-filter"&gt; &lt;Dropdown v-model="filters['brand']" :options="brands" optionLabel="brand" optionValue="value" placeholder="Select a Brand" class="p-column-filter" :showClear="true"&gt;
&lt;template #option="slotProps"&gt; &lt;template #option="slotProps"&gt;
&lt;div class="p-clearfix p-dropdown-car-option"&gt; &lt;div class="p-clearfix p-dropdown-car-option"&gt;
&lt;img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" /&gt; &lt;img :alt="slotProps.option.brand" :src="'demo/images/car/' + slotProps.option.brand + '.png'" /&gt;