From 6afa2ba690d6f8ef1f9b5e25e78821e4b365c828 Mon Sep 17 00:00:00 2001 From: liyl <295697141@qq.com> Date: Tue, 4 Apr 2017 15:40:39 +0800 Subject: [PATCH] Slider: feature - add format-tooltip prop (#3657) * Slider: add format-tooltip prop * Docs: update slider.md * Docs: update slider.md --- examples/docs/en-US/slider.md | 43 ++++++++++++++++++++++++---------- examples/docs/zh-CN/slider.md | 43 ++++++++++++++++++++++++---------- packages/slider/src/button.vue | 11 +++++++-- packages/slider/src/main.vue | 1 + test/unit/specs/slider.spec.js | 27 +++++++++++++++++++++ 5 files changed, 97 insertions(+), 28 deletions(-) diff --git a/examples/docs/en-US/slider.md b/examples/docs/en-US/slider.md index 8f3c8a8aa..1d3c29cd2 100644 --- a/examples/docs/en-US/slider.md +++ b/examples/docs/en-US/slider.md @@ -5,12 +5,18 @@ value1: 0, value2: 50, value3: 36, - value4: 42, - value5: 0, + value4: 48, + value5: 42, value6: 0, value7: 0, - value8: [4, 8] + value8: 0, + value9: [4, 8] }; + }, + methods: { + formatTooltip(val) { + return val / 100; + } } } @@ -39,9 +45,13 @@ The current value is displayed when the slider is being dragged. Hide Tooltip +
+ Format Tooltip + +
Disabled - +
@@ -52,7 +62,13 @@ The current value is displayed when the slider is being dragged. value1: 0, value2: 50, value3: 36, - value4: 42 + value4: 48, + value5: 42 + } + }, + methods: { + formatTooltip(val) { + return val / 100; } } } @@ -71,14 +87,14 @@ The options can be discrete.
Breakpoints not displayed
Breakpoints displayed @@ -89,8 +105,8 @@ The options can be discrete. export default { data() { return { - value5: 0, - value6: 0 + value6: 0, + value7: 0 } } } @@ -108,7 +124,7 @@ Set value via a input box.