Merge pull request #6357 from msidolphin/fix/#6349

fix: 修复#6349
This commit is contained in:
debugIsFalse 2019-11-08 11:23:37 +08:00 committed by GitHub
commit 1a98ac1a97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View file

@ -27,6 +27,10 @@
<Button @click="handleReset('formValidate')" style="margin-left: 8px">Reset</Button>
</FormItem>
</Form>
<!-- fix #6349 -->
<Select v-model='test' filterable clearable>
<Option v-for='item in list' :value='item.value' :label="item.name"></Option>
</Select>
</div>
</template>
<script>
@ -44,7 +48,15 @@
binterest: [
{ required: true, type: 'array', min: 1, message: 'Choose at least one hobby', trigger: 'change' },
],
}
},
test:'',
list:[{
name:"测试测试",
value:8
},{
name:"\"年龄\"123",
value:9
}]
}
},
methods: {

View file

@ -495,9 +495,14 @@
const nodeText = node.elm ? node.elm.textContent : node.text;
return `${str} ${nodeText}`;
}, '') || '';
const stringValues = JSON.stringify([label, textContent]);
const stringValues = [label, textContent];
const query = this.query.toLowerCase().trim();
return stringValues.toLowerCase().includes(query);
for (let i = 0; i < stringValues.length; ++i) {
if (stringValues[i].toLowerCase().includes(query)) {
return true;
}
}
return false;
},
toggleMenu (e, force) {