diff --git a/api-generator/components/knob.js b/api-generator/components/knob.js index 5d4a1895de..7c33022929 100644 --- a/api-generator/components/knob.js +++ b/api-generator/components/knob.js @@ -74,8 +74,8 @@ const KnobProps = [ { name: 'valueTemplate', type: 'function | string', - default: 'val => val', - description: 'Controls how the knob is labeled.' + default: '{value}', + description: 'Template of the value.' }, { name: 'tabindex', diff --git a/components/lib/knob/BaseKnob.vue b/components/lib/knob/BaseKnob.vue index a349b2f2e9..ac9ed865d5 100644 --- a/components/lib/knob/BaseKnob.vue +++ b/components/lib/knob/BaseKnob.vue @@ -56,7 +56,7 @@ export default { }, valueTemplate: { type: [String, Function], - default: () => (val) => val + default: '{value}' }, tabindex: { type: Number, diff --git a/components/lib/knob/Knob.d.ts b/components/lib/knob/Knob.d.ts index 7ed2c87f45..b69301d30b 100644 --- a/components/lib/knob/Knob.d.ts +++ b/components/lib/knob/Knob.d.ts @@ -176,7 +176,7 @@ export interface KnobProps { showValue?: boolean | undefined; /** * Template string of the value. - * @defaultValue 'val => val' + * @defaultValue '{value}' */ valueTemplate?: (val: number) => string | string | undefined; /** diff --git a/doc/knob/TemplateDoc.vue b/doc/knob/TemplateDoc.vue index 27e6285496..08cc2278c3 100644 --- a/doc/knob/TemplateDoc.vue +++ b/doc/knob/TemplateDoc.vue @@ -2,9 +2,8 @@

The label can be customized with the valueTemplate property using either a template string or a function.

-
+
-
@@ -17,13 +16,11 @@ export default { code: { basic: ` - `, options: ` @@ -39,9 +36,8 @@ export default { `, composition: `