Chips doc added
parent
a1265c7b9b
commit
efdd70a391
|
@ -35,7 +35,7 @@ export default {
|
|||
this.focused = true;
|
||||
this.$emit('focus', event);
|
||||
},
|
||||
onBlur() {
|
||||
onBlur(event) {
|
||||
this.focused = false;
|
||||
this.$emit('blur', event);
|
||||
},
|
||||
|
|
|
@ -21,16 +21,23 @@
|
|||
</template>
|
||||
</Chips>
|
||||
</div>
|
||||
|
||||
<ChipsDoc />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ChipsDoc from './ChipsDoc';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value1: null,
|
||||
value2: null
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'ChipsDoc': ChipsDoc
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,199 @@
|
|||
<template>
|
||||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h3>Import</h3>
|
||||
<CodeHighlight lang="javascript">
|
||||
import Chips from 'primevue/chips';
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Getting Started</h3>
|
||||
<p>Chips requires an array as its model.</p>
|
||||
<CodeHighlight>
|
||||
<Chips v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Custom Content</h3>
|
||||
<p>A chip is customized using a template element where the value is passed as the implicit variable.</p>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<Chips v-model="value">
|
||||
<template #chip="slotProps">
|
||||
<div>
|
||||
<span>{{slotProps.value}} - (active) </span>
|
||||
<i class="pi pi-user-plus" style="font-size: 14px"></i>
|
||||
</div>
|
||||
</template>
|
||||
</Chips>
|
||||
</template>
|
||||
</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>value</td>
|
||||
<td>array</td>
|
||||
<td>null</td>
|
||||
<td>Value of the component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>disabled</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>When present, it specifies that the element should be disabled.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>max</td>
|
||||
<td>number</td>
|
||||
<td>null</td>
|
||||
<td>Maximum number of entries allowed.</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>input</td>
|
||||
<td>value: New value of the component</td>
|
||||
<td>Callback to invoke on input event of input field.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>focus</td>
|
||||
<td>event: Browser event</td>
|
||||
<td>Callback to invoke when a input is focused.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>blur</td>
|
||||
<td>event: Browser event</td>
|
||||
<td>Callback to invoke when a input loses focus.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>add</td>
|
||||
<td>originalEvent: Browser event <br/>
|
||||
value: Added item value</td>
|
||||
<td>Callback to invoke when a chip is added.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>remove</td>
|
||||
<td>originalEvent: Browser event <br/>
|
||||
value: Removed item value</td>
|
||||
<td>Callback to invoke when a chip is removed.</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-chips</td>
|
||||
<td>Container element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-chips-token</td>
|
||||
<td>Chip element container.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-chips-token-icon</td>
|
||||
<td>Icon of a chip.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-chips-token-label</td>
|
||||
<td>label of a chip.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-chips-input-token</td>
|
||||
<td>Container of input 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/chips" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
||||
<span>View on GitHub</span>
|
||||
</a>
|
||||
<CodeHighlight>
|
||||
<template v-pre>
|
||||
<template>
|
||||
<div>
|
||||
<div class="content-section introduction">
|
||||
<div class="feature-intro">
|
||||
<h1>Chips</h1>
|
||||
<p>Chips is used to enter multiple values on an input field.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-section implementation">
|
||||
<h3 class="first">Basic</h3>
|
||||
<Chips v-model="value1" />
|
||||
|
||||
<h3>Template</h3>
|
||||
<Chips v-model="value2">
|
||||
<template #chip="slotProps">
|
||||
<div>
|
||||
<span>{{slotProps.value}} - (active) </span>
|
||||
<i class="pi pi-user-plus" style="font-size: 14px"></i>
|
||||
</div>
|
||||
</template>
|
||||
</Chips>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value1: null,
|
||||
value2: null
|
||||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
.p-chips .p-inputtext {
|
||||
width: 100%;
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue