From 847bed5bca6d2541079293d164351326ce80bb22 Mon Sep 17 00:00:00 2001 From: wangxueliang Date: Fri, 23 Mar 2018 11:06:50 +0800 Subject: [PATCH] update vc-slider --- components/vc-slider/src/Slider.jsx | 2 +- components/vc-slider/src/common/Track.jsx | 35 ++++++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/components/vc-slider/src/Slider.jsx b/components/vc-slider/src/Slider.jsx index b0af9d600..41a1094ad 100644 --- a/components/vc-slider/src/Slider.jsx +++ b/components/vc-slider/src/Slider.jsx @@ -172,7 +172,7 @@ class Slider extends React.Component { const _trackStyle = trackStyle[0] || trackStyle const track = ( { - const { className, included, vertical, offset, length, style } = props + const positonStyle = vertical ? { + bottom: `${offset}%`, + height: `${length}%`, + } : { + left: `${offset}%`, + width: `${length}%`, + } - const positonStyle = vertical ? { - bottom: `${offset}%`, - height: `${length}%`, - } : { - left: `${offset}%`, - width: `${length}%`, - } - - const elStyle = { - ...style, - ...positonStyle, - } - return included ?
: null + context.data.style = { + ...style, + ...positonStyle, + } + return included ? createElement('div', context.data, context.children) : null + }, } export default Track