Slider doc added
parent
39b113fa9f
commit
4187e348ec
|
@ -13,21 +13,21 @@ import DomHandler from '../utils/DomHandler';
|
|||
export default {
|
||||
props: {
|
||||
value: [Number,Array],
|
||||
disabled: Boolean,
|
||||
step: Number,
|
||||
range: Boolean,
|
||||
min: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 100
|
||||
},
|
||||
orientation: {
|
||||
type: String,
|
||||
default: 'horizontal'
|
||||
}
|
||||
min: {
|
||||
type: Number,
|
||||
default: 0
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 100
|
||||
},
|
||||
orientation: {
|
||||
type: String,
|
||||
default: 'horizontal'
|
||||
},
|
||||
step: Number,
|
||||
range: Boolean,
|
||||
disabled: Boolean
|
||||
},
|
||||
dragging: false,
|
||||
handleIndex: null,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<Slider v-model="value1" />
|
||||
|
||||
<h3>Input: {{value2}}</h3>
|
||||
<p-inputtext v-model.number="value2" />
|
||||
<InputText v-model.number="value2" />
|
||||
<Slider v-model="value2" />
|
||||
|
||||
<h3>Step: {{value3}}</h3>
|
||||
|
@ -24,10 +24,14 @@
|
|||
<h3>Vertical: {{value5}}</h3>
|
||||
<Slider v-model="value5" orientation="vertical" />
|
||||
</div>
|
||||
|
||||
<SliderDoc/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import SliderDoc from './SliderDoc';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -37,6 +41,9 @@ export default {
|
|||
value4: [20,80],
|
||||
value5: 50
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'SliderDoc': SliderDoc
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,231 @@
|
|||
<template>
|
||||
<div class="content-section documentation">
|
||||
<TabView>
|
||||
<TabPanel header="Documentation">
|
||||
<h3>Import</h3>
|
||||
<CodeHighlight lang="javascript">
|
||||
import Slider from 'primevue/slider';
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Getting Started</h3>
|
||||
<p>Two-way binding is defined using the standard v-model directive.</p>
|
||||
<CodeHighlight>
|
||||
<Slider v-model="value" />
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Range</h3>
|
||||
<p>Range slider provides two handles to define two values. Enable <i>range</i> property and bind an array to implement a range slider.</p>
|
||||
|
||||
<CodeHighlight>
|
||||
<Slider v-model="value" :range="true" />
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="js">
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value: [20,80]
|
||||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Orientation</h3>
|
||||
<p>Default layout of slider is horizontal, use <i>orientation</i> property for the alternative vertical mode.</p>
|
||||
<CodeHighlight>
|
||||
<Slider v-model="value" orientation="vertical" />
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Step</h3>
|
||||
<p>Step factor is 1 by default and can be customized with step option.</p>
|
||||
<CodeHighlight>
|
||||
<Slider v-model="value" :step="20" />
|
||||
</CodeHighlight>
|
||||
|
||||
<h3>Min-Max</h3>
|
||||
<p>Boundaries are specified with min and max attributes.</p>
|
||||
<CodeHighlight>
|
||||
<Slider v-model="value" :step="20" :min="50" :max="200" />
|
||||
</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>number</td>
|
||||
<td>0</td>
|
||||
<td>Value of the component.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>min</td>
|
||||
<td>number</td>
|
||||
<td>0</td>
|
||||
<td>Mininum boundary value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>max</td>
|
||||
<td>number</td>
|
||||
<td>100</td>
|
||||
<td>Maximum boundary value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>orientation</td>
|
||||
<td>string</td>
|
||||
<td>horizontal</td>
|
||||
<td>Orientation of the slider, valid values are horizontal and vertical.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>step</td>
|
||||
<td>number</td>
|
||||
<td>1</td>
|
||||
<td>Step factor to increment/decrement the value.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>range</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>When speficed, allows two boundary values to be picked.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>disabled</td>
|
||||
<td>boolean</td>
|
||||
<td>false</td>
|
||||
<td>When present, it specifies that the component should be disabled.</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: New value.</td>
|
||||
<td>Callback to invoke on value change via slide.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>input</td>
|
||||
<td>event: New value.</td>
|
||||
<td>Callback to invoke on value change via slide.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>slideEnd</td>
|
||||
<td>event.originalEvent: Slide event <br />
|
||||
event.value: New value.
|
||||
</td>
|
||||
<td>Callback to invoke when slide ends.</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-slider</td>
|
||||
<td>Container element</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>p-slider-handle</td>
|
||||
<td>Handle 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/slider" 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>Slider</h1>
|
||||
<p>Slider is an input component to provide a numerical input.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-section implementation">
|
||||
<h3 class="first">Basic: {{value1}}</h3>
|
||||
<Slider v-model="value1" />
|
||||
|
||||
<h3>Input: {{value2}}</h3>
|
||||
<InputText v-model.number="value2" />
|
||||
<Slider v-model="value2" />
|
||||
|
||||
<h3>Step: {{value3}}</h3>
|
||||
<Slider v-model="value3" :step="20" />
|
||||
|
||||
<h3>Range: {{value4}}</h3>
|
||||
<Slider v-model="value4" :range="true" />
|
||||
|
||||
<h3>Vertical: {{value5}}</h3>
|
||||
<Slider v-model="value5" orientation="vertical" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="javascript">
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
value1: null,
|
||||
value2: 50,
|
||||
value3: 20,
|
||||
value4: [20,80],
|
||||
value5: 50
|
||||
}
|
||||
}
|
||||
}
|
||||
</CodeHighlight>
|
||||
|
||||
<CodeHighlight lang="css">
|
||||
.p-slider-horizontal, .p-inputtext {
|
||||
width: 14em;
|
||||
}
|
||||
|
||||
.p-slider-vertical {
|
||||
height: 14em;
|
||||
}
|
||||
</CodeHighlight>
|
||||
</TabPanel>
|
||||
</TabView>
|
||||
</div>
|
||||
</template>
|
Loading…
Reference in New Issue