Fixed #5616
parent
e747e01e3d
commit
e7ec2ad79a
|
@ -74,8 +74,8 @@ const KnobProps = [
|
||||||
{
|
{
|
||||||
name: 'valueTemplate',
|
name: 'valueTemplate',
|
||||||
type: 'function | string',
|
type: 'function | string',
|
||||||
default: 'val => val',
|
default: '{value}',
|
||||||
description: 'Controls how the knob is labeled.'
|
description: 'Template of the value.'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'tabindex',
|
name: 'tabindex',
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
},
|
},
|
||||||
valueTemplate: {
|
valueTemplate: {
|
||||||
type: [String, Function],
|
type: [String, Function],
|
||||||
default: () => (val) => val
|
default: '{value}'
|
||||||
},
|
},
|
||||||
tabindex: {
|
tabindex: {
|
||||||
type: Number,
|
type: Number,
|
||||||
|
|
|
@ -176,7 +176,7 @@ export interface KnobProps {
|
||||||
showValue?: boolean | undefined;
|
showValue?: boolean | undefined;
|
||||||
/**
|
/**
|
||||||
* Template string of the value.
|
* Template string of the value.
|
||||||
* @defaultValue 'val => val'
|
* @defaultValue '{value}'
|
||||||
*/
|
*/
|
||||||
valueTemplate?: (val: number) => string | string | undefined;
|
valueTemplate?: (val: number) => string | string | undefined;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
<DocSectionText v-bind="$attrs">
|
<DocSectionText v-bind="$attrs">
|
||||||
<p>The label can be customized with the <i>valueTemplate</i> property using either a template string or a function.</p>
|
<p>The label can be customized with the <i>valueTemplate</i> property using either a template string or a function.</p>
|
||||||
</DocSectionText>
|
</DocSectionText>
|
||||||
<div class="card flex justify-content-center gap-4">
|
<div class="card flex justify-content-center">
|
||||||
<Knob v-model="value" valueTemplate="{value}%" />
|
<Knob v-model="value" valueTemplate="{value}%" />
|
||||||
<Knob v-model="value" :valueTemplate="(val) => val / 100" />
|
|
||||||
</div>
|
</div>
|
||||||
<DocSectionCode :code="code" />
|
<DocSectionCode :code="code" />
|
||||||
</template>
|
</template>
|
||||||
|
@ -17,13 +16,11 @@ export default {
|
||||||
code: {
|
code: {
|
||||||
basic: `
|
basic: `
|
||||||
<Knob v-model="value" valueTemplate="{value}%" />
|
<Knob v-model="value" valueTemplate="{value}%" />
|
||||||
<Knob v-model="value" :valueTemplate="val => val / 100" />
|
|
||||||
`,
|
`,
|
||||||
options: `
|
options: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card flex justify-content-center gap-4">
|
<div class="card flex justify-content-center">
|
||||||
<Knob v-model="value" valueTemplate="{value}%" />
|
<Knob v-model="value" valueTemplate="{value}%" />
|
||||||
<Knob v-model="value" :valueTemplate="val => val / 100" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -39,9 +36,8 @@ export default {
|
||||||
`,
|
`,
|
||||||
composition: `
|
composition: `
|
||||||
<template>
|
<template>
|
||||||
<div class="card flex justify-content-center gap-4">
|
<div class="card flex justify-content-center">
|
||||||
<Knob v-model="value" valueTemplate="{value}%" />
|
<Knob v-model="value" valueTemplate="{value}%" />
|
||||||
<Knob v-model="value" :valueTemplate="val => val / 100" />
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue