mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-04 04:58:16 +08:00
fix: vc-slider Range
This commit is contained in:
parent
e825830079
commit
8e533e6b8e
@ -19,17 +19,15 @@ export default {
|
|||||||
},
|
},
|
||||||
render () {
|
render () {
|
||||||
const handle = (h, props) => {
|
const handle = (h, props) => {
|
||||||
const { value, dragging, index, refStr, style, ...restProps } = props
|
const { value, dragging, index, ref, style, ...restProps } = props
|
||||||
const handleProps = {
|
const handleProps = {
|
||||||
props: {
|
props: {
|
||||||
...restProps,
|
...restProps,
|
||||||
value,
|
value,
|
||||||
},
|
},
|
||||||
attrs: {
|
|
||||||
refStr,
|
|
||||||
},
|
|
||||||
key: index,
|
key: index,
|
||||||
style,
|
style,
|
||||||
|
ref,
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<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 tipFormatter = value => `${value}%`
|
||||||
const tipProps = {}
|
const tipProps = {}
|
||||||
|
|
||||||
@ -85,6 +83,7 @@ export default {
|
|||||||
style: {
|
style: {
|
||||||
...handleStyleWithIndex,
|
...handleStyleWithIndex,
|
||||||
},
|
},
|
||||||
|
ref,
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -118,7 +118,7 @@ const Range = {
|
|||||||
this.onChange({ bounds: nextBounds })
|
this.onChange({ bounds: nextBounds })
|
||||||
},
|
},
|
||||||
onEnd () {
|
onEnd () {
|
||||||
this.setState({ sHandle: null }, this.onBlur)
|
this.setState({ sHandle: null }, this.blur)
|
||||||
this.removeDocumentEvents()
|
this.removeDocumentEvents()
|
||||||
this.$emit('afterChange', this.bounds)
|
this.$emit('afterChange', this.bounds)
|
||||||
},
|
},
|
||||||
@ -210,7 +210,7 @@ const Range = {
|
|||||||
nextHandle = nextBounds.indexOf(value)
|
nextHandle = nextBounds.indexOf(value)
|
||||||
}
|
}
|
||||||
this.onChange({
|
this.onChange({
|
||||||
handle: nextHandle,
|
sHandle: nextHandle,
|
||||||
bounds: nextBounds,
|
bounds: nextBounds,
|
||||||
})
|
})
|
||||||
if (isFromKeyboardEvent) {
|
if (isFromKeyboardEvent) {
|
||||||
|
@ -6,7 +6,7 @@ import Handle from './Handle'
|
|||||||
|
|
||||||
export default function createSliderWithTooltip (Component) {
|
export default function createSliderWithTooltip (Component) {
|
||||||
return {
|
return {
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin, Component],
|
||||||
props: {
|
props: {
|
||||||
...Component.props,
|
...Component.props,
|
||||||
tipFormatter: PropTypes.func.def((value) => { return value }),
|
tipFormatter: PropTypes.func.def((value) => { return value }),
|
||||||
|
Loading…
Reference in New Issue
Block a user