fix: AutoComplete can not delete last character #1429
parent
59dc98dbd1
commit
cece7332cb
|
@ -1,5 +1,6 @@
|
||||||
import PropTypes from '../_util/vue-types';
|
import PropTypes from '../_util/vue-types';
|
||||||
import { cloneElement } from '../_util/vnode';
|
import { cloneElement } from '../_util/vnode';
|
||||||
|
import { getOptionProps } from '../_util/props-util';
|
||||||
function chaining(...fns) {
|
function chaining(...fns) {
|
||||||
return function(...args) {
|
return function(...args) {
|
||||||
// eslint-disable-line
|
// eslint-disable-line
|
||||||
|
@ -12,6 +13,7 @@ function chaining(...fns) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
|
name: 'InputElement',
|
||||||
props: {
|
props: {
|
||||||
value: PropTypes.any,
|
value: PropTypes.any,
|
||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
|
@ -29,7 +31,8 @@ export default {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const { $slots = {}, $listeners = {}, $props = {}, $attrs = {} } = this;
|
const { $slots = {}, $listeners = {}, $props = {}, $attrs = {} } = this;
|
||||||
const value = $props.value === undefined ? '' : $props.value;
|
const props = getOptionProps(this);
|
||||||
|
const value = props.value === undefined ? '' : props.value;
|
||||||
const children = $slots.default[0];
|
const children = $slots.default[0];
|
||||||
const { componentOptions = {} } = $slots.default[0];
|
const { componentOptions = {} } = $slots.default[0];
|
||||||
const { listeners = {} } = componentOptions;
|
const { listeners = {} } = componentOptions;
|
||||||
|
@ -43,7 +46,7 @@ export default {
|
||||||
domProps: {
|
domProps: {
|
||||||
value,
|
value,
|
||||||
},
|
},
|
||||||
props: $props,
|
props,
|
||||||
on: newEvent,
|
on: newEvent,
|
||||||
attrs: { ...$attrs, value },
|
attrs: { ...$attrs, value },
|
||||||
ref: 'ele',
|
ref: 'ele',
|
||||||
|
|
|
@ -304,7 +304,7 @@ const Select = {
|
||||||
|
|
||||||
onInputChange(e) {
|
onInputChange(e) {
|
||||||
const { value: val, composing } = e.target;
|
const { value: val, composing } = e.target;
|
||||||
const { _inputValue = '' } = this;
|
const { _inputValue = '' } = this.$data;
|
||||||
if (composing || _inputValue === val) return;
|
if (composing || _inputValue === val) return;
|
||||||
const { tokenSeparators } = this.$props;
|
const { tokenSeparators } = this.$props;
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue