🐛(component): 修复穿梭框无法检索的问题

This commit is contained in:
就眠儀式 2022-09-13 16:20:47 +08:00
parent 800aa23eff
commit 3c5d5359f7
2 changed files with 11 additions and 8 deletions

View File

@ -47,10 +47,13 @@ const isHalf = computed(
() => props.half && Math.round(currentValue.value) !== currentValue.value () => props.half && Math.round(currentValue.value) !== currentValue.value
); );
watch(() => props.modelValue, () => { watch(
currentValue.value = props.modelValue; () => props.modelValue,
tempValue.value = props.modelValue; () => {
}) currentValue.value = props.modelValue;
tempValue.value = props.modelValue;
}
);
// //
const getValue = function (index: number, event: any): number { const getValue = function (index: number, event: any): number {
if (!props.half) { if (!props.half) {

View File

@ -166,22 +166,22 @@ const remove = () => {
}; };
const searchLeft = (e: any) => { const searchLeft = (e: any) => {
if (e.target.value === "") { if (e === "") {
leftDataSource.value = _leftDataSource.value; leftDataSource.value = _leftDataSource.value;
} }
leftDataSource.value = _leftDataSource.value.filter((item) => { leftDataSource.value = _leftDataSource.value.filter((item) => {
if (item.title.indexOf(e.target.value) != -1) { if (item.title.indexOf(e) != -1) {
return item; return item;
} }
}); });
}; };
const searchRight = (e: any) => { const searchRight = (e: any) => {
if (e.target.value === "") { if (e === "") {
rightDataSource.value = _rightDataSource.value; rightDataSource.value = _rightDataSource.value;
} }
rightDataSource.value = _rightDataSource.value.filter((item) => { rightDataSource.value = _rightDataSource.value.filter((item) => {
if (item.title.indexOf(e.target.value) != -1) { if (item.title.indexOf(e) != -1) {
return item; return item;
} }
}); });