update vc-slider
parent
3bd916b73e
commit
847bed5bca
|
@ -172,7 +172,7 @@ class Slider extends React.Component {
|
|||
const _trackStyle = trackStyle[0] || trackStyle
|
||||
const track = (
|
||||
<Track
|
||||
className={`${prefixCls}-track`}
|
||||
class={`${prefixCls}-track`}
|
||||
vertical={vertical}
|
||||
included={included}
|
||||
offset={0}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
/* eslint-disable react/prop-types */
|
||||
import React from 'react'
|
||||
|
||||
const Track = (props) => {
|
||||
const { className, included, vertical, offset, length, style } = props
|
||||
/* eslint-disable */
|
||||
const Track = {
|
||||
functional: true,
|
||||
render (createElement, context) {
|
||||
const { included, vertical, offset, length, style } = context.data
|
||||
|
||||
const positonStyle = vertical ? {
|
||||
bottom: `${offset}%`,
|
||||
|
@ -12,11 +12,12 @@ const Track = (props) => {
|
|||
width: `${length}%`,
|
||||
}
|
||||
|
||||
const elStyle = {
|
||||
context.data.style = {
|
||||
...style,
|
||||
...positonStyle,
|
||||
}
|
||||
return included ? <div className={className} style={elStyle} /> : null
|
||||
return included ? createElement('div', context.data, context.children) : null
|
||||
},
|
||||
}
|
||||
|
||||
export default Track
|
||||
|
|
Loading…
Reference in New Issue