fix: vc-slider Range

This commit is contained in:
wangxueliang 2018-11-29 16:41:11 +08:00
parent e825830079
commit 8e533e6b8e
3 changed files with 7 additions and 8 deletions

View File

@ -19,17 +19,15 @@ export default {
},
render () {
const handle = (h, props) => {
const { value, dragging, index, refStr, style, ...restProps } = props
const { value, dragging, index, ref, style, ...restProps } = props
const handleProps = {
props: {
...restProps,
value,
},
attrs: {
refStr,
},
key: index,
style,
ref,
}
return (
<Tooltip
@ -45,7 +43,7 @@ export default {
)
}
const handleRange = (h, { value, dragging, index, disabled, style, ...restProps }) => {
const handleRange = (h, { value, ref, dragging, index, disabled, style, ...restProps }) => {
const tipFormatter = value => `${value}%`
const tipProps = {}
@ -85,6 +83,7 @@ export default {
style: {
...handleStyleWithIndex,
},
ref,
}
return (

View File

@ -118,7 +118,7 @@ const Range = {
this.onChange({ bounds: nextBounds })
},
onEnd () {
this.setState({ sHandle: null }, this.onBlur)
this.setState({ sHandle: null }, this.blur)
this.removeDocumentEvents()
this.$emit('afterChange', this.bounds)
},
@ -210,7 +210,7 @@ const Range = {
nextHandle = nextBounds.indexOf(value)
}
this.onChange({
handle: nextHandle,
sHandle: nextHandle,
bounds: nextBounds,
})
if (isFromKeyboardEvent) {

View File

@ -6,7 +6,7 @@ import Handle from './Handle'
export default function createSliderWithTooltip (Component) {
return {
mixins: [BaseMixin],
mixins: [BaseMixin, Component],
props: {
...Component.props,
tipFormatter: PropTypes.func.def((value) => { return value }),