Doc update for SelectButton

pull/12/head
cagataycivici 2019-05-22 16:55:12 +03:00
parent 9b2cdeae83
commit 1e96522df8
4 changed files with 82 additions and 92 deletions

View File

@ -19,12 +19,11 @@ export default {
value: null, value: null,
options: Array, options: Array,
optionLabel: null, optionLabel: null,
optionValue: null,
optionDisabled: null,
multiple: Boolean, multiple: Boolean,
disabled: Boolean, disabled: Boolean,
dataKey: null, dataKey: null
name: String,
optionValue: null,
optionDisabled: null
}, },
data() { data() {
return { return {

View File

@ -8,7 +8,7 @@ import Dropdown from 'primevue/dropdown';
</CodeHighlight> </CodeHighlight>
<h3>Getting Started</h3> <h3>Getting Started</h3>
<p>Dropdown 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> <p>Dropdown requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the label property of the option.</p>
<CodeHighlight> <CodeHighlight>
&lt;Dropdown v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;name&quot; placeholder=&quot;Select a City&quot; /&gt; &lt;Dropdown v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;name&quot; placeholder=&quot;Select a City&quot; /&gt;
</CodeHighlight> </CodeHighlight>

View File

@ -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 and a collection 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 label property of the option.</p>
<CodeHighlight> <CodeHighlight>
&lt;MultiSelect v-model=&quot;selectedCars&quot; :options=&quot;cars&quot; optionLabel=&quot;brand&quot; placeholder=&quot;Select Brands&quot; /&gt; &lt;MultiSelect v-model=&quot;selectedCars&quot; :options=&quot;cars&quot; optionLabel=&quot;brand&quot; placeholder=&quot;Select Brands&quot; /&gt;
</CodeHighlight> </CodeHighlight>

View File

@ -8,7 +8,7 @@ import SelectButton from 'primevue/selectbutton';
</CodeHighlight> </CodeHighlight>
<h3>Getting Started</h3> <h3>Getting Started</h3>
<p>SelectButton 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>SelectButton requires a value to bind and a collection of arbitrary objects along with the <i>optionLabel</i> property to specify the label property of the option.</p>
<CodeHighlight> <CodeHighlight>
&lt;SelectButton v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;name&quot; /&gt; &lt;SelectButton v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;name&quot; /&gt;
</CodeHighlight> </CodeHighlight>
@ -34,11 +34,8 @@ export default {
&lt;SelectButton v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;brand&quot; :multiple=&quot;true&quot; /&gt; &lt;SelectButton v-model=&quot;selectedCity&quot; :options=&quot;cities&quot; optionLabel=&quot;brand&quot; :multiple=&quot;true&quot; /&gt;
</CodeHighlight> </CodeHighlight>
<h3>Disabled Options</h3>
<p>Particular options can be prevented from selection using the optionDisabled property.</p>
<h3>Templating</h3> <h3>Templating</h3>
<p>Items support templating to display custom content inside the buttons using an template that receives the option as the implicit variable. </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>
&lt;SelectButton v-model=&quot;selectedCar&quot; :options=&quot;cars&quot; optionLabel=&quot;brand&quot;&gt; &lt;SelectButton v-model=&quot;selectedCar&quot; :options=&quot;cars&quot; optionLabel=&quot;brand&quot;&gt;
@ -74,13 +71,25 @@ export default {
<td>options</td> <td>options</td>
<td>array</td> <td>array</td>
<td>null</td> <td>null</td>
<td>An array of objects to display as the available options.</td> <td>An array of selectitems to display as the available options.</td>
</tr> </tr>
<tr> <tr>
<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>multiple</td> <td>multiple</td>
@ -100,24 +109,6 @@ export default {
<td>null</td> <td>null</td>
<td>A property to uniquely match the value in options for better performance.</td> <td>A property to uniquely match the value in options for better performance.</td>
</tr> </tr>
<tr>
<td>name</td>
<td>string</td>
<td>null</td>
<td>???</td>
</tr>
<tr>
<td>optionValue</td>
<td>any</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>