InputNumber: prevent drag event (#9968)

pull/9969/head
杨奕 2018-03-02 12:14:26 +08:00 committed by GitHub
parent bc39454c93
commit f5aefcdb78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 9 deletions

View File

@ -1,20 +1,20 @@
<template> <template>
<div class="el-input-number" <div
@dragstart.prevent
:class="[ :class="[
'el-input-number',
inputNumberSize ? 'el-input-number--' + inputNumberSize : '', inputNumberSize ? 'el-input-number--' + inputNumberSize : '',
{ 'is-disabled': inputNumberDisabled }, { 'is-disabled': inputNumberDisabled },
{ 'is-without-controls': !controls }, { 'is-without-controls': !controls },
{ 'is-controls-right': controlsAtRight } { 'is-controls-right': controlsAtRight }
]" ]">
>
<span <span
class="el-input-number__decrease" class="el-input-number__decrease"
role="button" role="button"
v-if="controls" v-if="controls"
v-repeat-click="decrease" v-repeat-click="decrease"
:class="{'is-disabled': minDisabled}" :class="{'is-disabled': minDisabled}"
@keydown.enter="decrease" @keydown.enter="decrease">
>
<i :class="`el-icon-${controlsAtRight ? 'arrow-down' : 'minus'}`"></i> <i :class="`el-icon-${controlsAtRight ? 'arrow-down' : 'minus'}`"></i>
</span> </span>
<span <span
@ -23,8 +23,7 @@
v-if="controls" v-if="controls"
v-repeat-click="increase" v-repeat-click="increase"
:class="{'is-disabled': maxDisabled}" :class="{'is-disabled': maxDisabled}"
@keydown.enter="increase" @keydown.enter="increase">
>
<i :class="`el-icon-${controlsAtRight ? 'arrow-up' : 'plus'}`"></i> <i :class="`el-icon-${controlsAtRight ? 'arrow-up' : 'plus'}`"></i>
</span> </span>
<el-input <el-input
@ -40,8 +39,7 @@
@keydown.down.native.prevent="decrease" @keydown.down.native.prevent="decrease"
@blur="handleBlur" @blur="handleBlur"
@focus="handleFocus" @focus="handleFocus"
@change="handleInputChange" @change="handleInputChange">
>
<template slot="prepend" v-if="$slots.prepend"> <template slot="prepend" v-if="$slots.prepend">
<slot name="prepend"></slot> <slot name="prepend"></slot>
</template> </template>