Doc refactor for MultiSelect and Dropdown
parent
f1c9783bde
commit
9b2cdeae83
|
@ -61,6 +61,8 @@ export default {
|
||||||
value: null,
|
value: null,
|
||||||
options: Array,
|
options: Array,
|
||||||
optionLabel: null,
|
optionLabel: null,
|
||||||
|
optionValue: null,
|
||||||
|
optionDisabled: null,
|
||||||
scrollHeight: {
|
scrollHeight: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '200px'
|
default: '200px'
|
||||||
|
@ -70,8 +72,6 @@ export default {
|
||||||
filter: Boolean,
|
filter: Boolean,
|
||||||
tabindex: String,
|
tabindex: String,
|
||||||
dataKey: null,
|
dataKey: null,
|
||||||
optionValue: null,
|
|
||||||
optionDisabled: null,
|
|
||||||
filterPlaceholder: String
|
filterPlaceholder: String
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
|
@ -39,7 +39,7 @@ data() {
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Custom Content</h3>
|
<h3>Custom Content</h3>
|
||||||
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>item</i> template that gets the option instance as a parameter and returns the content.</p>
|
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>option</i> template that gets the option instance as a parameter.</p>
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<template v-pre>
|
<template v-pre>
|
||||||
<Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" placeholder="Select a Car" :filter="true" :showClear="true">
|
<Dropdown v-model="selectedCar" :options="cars" optionLabel="brand" placeholder="Select a Car" :filter="true" :showClear="true">
|
||||||
|
|
|
@ -8,7 +8,7 @@ import MultiSelect from 'primevue/multiselect';
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Getting Started</h3>
|
<h3>Getting Started</h3>
|
||||||
<p>MultiSelect requires a value to bind, optionLabel and a collection of options. How to define the options property; Providing an array of arbitrary objects along with the <i>optionLabel</i> property to specify the field name of the option.</p>
|
<p>MultiSelect requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the field name of the option.</p>
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<MultiSelect v-model="selectedCars" :options="cars" optionLabel="brand" placeholder="Select Brands" />
|
<MultiSelect v-model="selectedCars" :options="cars" optionLabel="brand" placeholder="Select Brands" />
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
@ -33,12 +33,11 @@ data() {
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Custom Content</h3>
|
<h3>Custom Content</h3>
|
||||||
<p>Label of an option is used as the display text of an item by default, for custom content support define a template where
|
<p>Label of an option is used as the display text of an item by default, for custom content support define an <i>option</i> template that gets the option instance as a parameter.</p>
|
||||||
the local template variable refers to an option in the options collection. </p>
|
<p>In addition the <i>value</i> template can be used to customize the selected values display instead of the default comma separated list.</p>
|
||||||
<p>In addition <i>#value</i> can be used to customize the selected values display instead of the default comma separated list.</p>
|
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<template v-pre>
|
<template v-pre>
|
||||||
<MultiSelect v-model="selectedCars2" :options="cars" optionLabel="brand" placeholder="Select a Car" :filter="true">
|
<MultiSelect v-model="selectedCars2" :options="cars" optionLabel="brand" placeholder="Select a Car">
|
||||||
<template #value="slotProps">
|
<template #value="slotProps">
|
||||||
<div class="p-multiselect-car-token" v-for="option of slotProps.value" :key="option.brand">
|
<div class="p-multiselect-car-token" v-for="option of slotProps.value" :key="option.brand">
|
||||||
<img :alt="option.brand" :src="'/demo/images/car/' + option.brand + '.png'" />
|
<img :alt="option.brand" :src="'/demo/images/car/' + option.brand + '.png'" />
|
||||||
|
@ -59,7 +58,7 @@ data() {
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
|
||||||
<h3>Filter</h3>
|
<h3>Filter</h3>
|
||||||
<p>Filtering allows searching items in the list using an input field at the header. In order to use filtering, enable filter property.</p>
|
<p>Filtering allows searching items in the list using an input field at the header. In order to use filtering, enable the <i>filter</i> property.</p>
|
||||||
<CodeHighlight>
|
<CodeHighlight>
|
||||||
<MultiSelect v-model="selectedCars" :options="cars" :filter="true" optionLabel="brand" placeholder="Select Brands"/>
|
<MultiSelect v-model="selectedCars" :options="cars" :filter="true" optionLabel="brand" placeholder="Select Brands"/>
|
||||||
</CodeHighlight>
|
</CodeHighlight>
|
||||||
|
@ -78,7 +77,7 @@ data() {
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>value</td>
|
<td>value</td>
|
||||||
<td>array</td>
|
<td>any</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Value of the component.</td>
|
<td>Value of the component.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -92,7 +91,19 @@ data() {
|
||||||
<td>optionLabel</td>
|
<td>optionLabel</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Name of the label field of an option when an arbitrary objects instead of SelectItems are used as options.</td>
|
<td>Property name to use as the label of an option.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>optionValue</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Property name to use as the value of an option, defaults to the option itself when not defined.</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>optionDisabled</td>
|
||||||
|
<td>boolean</td>
|
||||||
|
<td>null</td>
|
||||||
|
<td>Property name to use as the disabled flag of an option, defaults to false when not defined.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>scrollHeight</td>
|
<td>scrollHeight</td>
|
||||||
|
@ -119,7 +130,7 @@ data() {
|
||||||
<td>When specified, displays an input field to filter the items on keyup.</td>
|
<td>When specified, displays an input field to filter the items on keyup.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>tabIndex</td>
|
<td>tabindex</td>
|
||||||
<td>string</td>
|
<td>string</td>
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Index of the element in tabbing order.</td>
|
<td>Index of the element in tabbing order.</td>
|
||||||
|
@ -136,18 +147,6 @@ data() {
|
||||||
<td>null</td>
|
<td>null</td>
|
||||||
<td>Placeholder text to show when filter input is empty.</td>
|
<td>Placeholder text to show when filter input is empty.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>optionValue</td>
|
|
||||||
<td>string</td>
|
|
||||||
<td>null</td>
|
|
||||||
<td>???</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>optionDisabled</td>
|
|
||||||
<td>boolean</td>
|
|
||||||
<td>null</td>
|
|
||||||
<td>???</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -165,16 +164,14 @@ data() {
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>change</td>
|
<td>change</td>
|
||||||
<td>event.originalEvent: Browser event<br />
|
<td>event.originalEvent: Original event <br />
|
||||||
event.value: Current selected values<br />
|
event.value: Selected option value </td>
|
||||||
</td>
|
<td>Callback to invoke on value change.</td>
|
||||||
<td>Callback to invoke when value changes.</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>input</td>
|
<td>input</td>
|
||||||
<td>event: Current selected values<br />
|
<td>value: New value</td>
|
||||||
</td>
|
<td>Callback to invoke on value change.</td>
|
||||||
<td>Callback to invoke when value changes.</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue