TriStateCheckbox doc added

pull/12/head
Merve Özçifçi 2019-03-27 13:21:45 +03:00
parent d7fcce82f8
commit b15e2372f5
3 changed files with 193 additions and 7 deletions

View File

@ -13,12 +13,12 @@
<script> <script>
export default { export default {
props: { props: {
inputId: String,
value: null, value: null,
name: String, name: String,
inputId: String, disabled: Boolean,
autofocus: Boolean, autofocus: Boolean,
autocomplete: String, autocomplete: String
disabled: Boolean
}, },
data() { data() {
return { return {
@ -54,7 +54,7 @@ export default {
this.focused = true; this.focused = true;
this.$emit('focus', event); this.$emit('focus', event);
}, },
onBlur() { onBlur(event) {
this.focused = false; this.focused = false;
this.$emit('blur', event); this.$emit('blur', event);
} }

View File

@ -11,15 +11,22 @@
<TriStateCheckbox v-model="value" /> <TriStateCheckbox v-model="value" />
<p>Value: <span style="font-weight: bold">{{value == null ? 'null' : value}}</span></p> <p>Value: <span style="font-weight: bold">{{value == null ? 'null' : value}}</span></p>
</div> </div>
<TriStateCheckboxDoc/>
</div> </div>
</template> </template>
<script> <script>
import TriStateCheckboxDoc from './TriStateCheckboxDoc';
export default { export default {
data() { data() {
return { return {
value: null value: null
} }
},
components: {
'TriStateCheckboxDoc': TriStateCheckboxDoc
} }
} }
</script> </script>

View File

@ -0,0 +1,179 @@
<template>
<div class="content-section documentation">
<TabView>
<TabPanel header="Documentation">
<h3>Import</h3>
<CodeHighlight lang="javascript">
import TriStateCheckbox from 'primevue/tristatecheckbox';
</CodeHighlight>
<h3>Getting Started</h3>
<p>A model can be bound using the standard v-model directive.</p>
<CodeHighlight>
&lt;TriStateCheckbox v-model=&quot;value&quot; /&gt;
</CodeHighlight>
<h3>Properties</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>inputId</td>
<td>string</td>
<td>null</td>
<td>Unique identifier of the native checkbox element.</td>
</tr>
<tr>
<td>value</td>
<td>any</td>
<td>null</td>
<td>Value of the TriStateCheckbox.</td>
</tr>
<tr>
<td>name</td>
<td>string</td>
<td>null</td>
<td>Name of the checkbox element .</td>
</tr>
<tr>
<td>disabled</td>
<td>boolean</td>
<td>false</td>
<td>When present, it specifies that the element value cannot be altered.</td>
</tr>
<tr>
<td>autocomplete</td>
<td>string</td>
<td>null</td>
<td>When specifies, whether or not an the element should have autocomplete enabled.</td>
</tr>
<tr>
<td>autofocus</td>
<td>boolean</td>
<td>false</td>
<td>When present, it specifies that the element should automatically get focus when the page loads.</td>
</tr>
</tbody>
</table>
</div>
<h3>Events</h3>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Parameters</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>change</td>
<td>event: Browser event</td>
<td>Callback to invoke on value change.</td>
</tr>
<tr>
<td>input</td>
<td>event: Value of checkbox</td>
<td>Callback to invoke on click.</td>
</tr>
<tr>
<td>click</td>
<td>event: Browser event</td>
<td>Callback to invoke click.</td>
</tr>
<tr>
<td>focus</td>
<td>event: Browser event</td>
<td>Callback to invoke on focus.</td>
</tr>
<tr>
<td>blur</td>
<td>event: Browser event</td>
<td>Callback to invoke on blur.</td>
</tr>
</tbody>
</table>
</div>
<h3>Styling</h3>
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
<div class="doc-tablewrapper">
<table class="doc-table">
<thead>
<tr>
<th>Name</th>
<th>Element</th>
</tr>
</thead>
<tbody>
<tr>
<td>p-chkbox</td>
<td>Container element</td>
</tr>
<tr>
<td>p-tristatechkbox</td>
<td>Container element</td>
</tr>
<tr>
<td>p-chkbox-box</td>
<td>Container of icon.</td>
</tr>
<tr>
<td>p-chkbox-icon</td>
<td>Icon element.</td>
</tr>
</tbody>
</table>
</div>
<h3>Dependencies</h3>
<p>None.</p>
</TabPanel>
<TabPanel header="Source">
<a href="https://github.com/primefaces/primevue/tree/master/src/views/tristatecheckbox" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
<span>View on GitHub</span>
</a>
<CodeHighlight>
<template v-pre>
&lt;template&gt;
&lt;div&gt;
&lt;div class=&quot;content-section introduction&quot;&gt;
&lt;div class=&quot;feature-intro&quot;&gt;
&lt;h1&gt;TriStateCheckbox&lt;/h1&gt;
&lt;p&gt;TriStateCheckbox is used to select either &quot;true&quot;, &quot;false&quot; or &quot;null&quot; as the value.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;content-section implementation&quot;&gt;
&lt;TriStateCheckbox v-model=&quot;value&quot; /&gt;
&lt;p&gt;Value: &lt;span style=&quot;font-weight: bold&quot;&gt;{{value == null ? 'null' : value}}&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/template&gt;
</template>
</CodeHighlight>
<CodeHighlight lang="javascript">
export default {
data() {
return {
value: null
}
}
}
</CodeHighlight>
</TabPanel>
</TabView>
</div>
</template>