Skip to content

Commit

Permalink
检测输入字符为空时返回,解决超大的树集合选项 (8000+节点),浏览器会出现卡顿现象
Browse files Browse the repository at this point in the history
当第一个字符输入 空格 时,浏览器会出现卡顿现象(感觉这个空格后来又被吃掉了,但是吃掉的过程中导致了浏览器卡顿)

riophae#369
  • Loading branch information
emacle committed Jul 12, 2020
1 parent 9ae16b6 commit c3a31a4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# clone @riophae/vue-treeselect
解决大数据集时,首字母为空格或者中文输入法搜索时卡顿现象

https://github.com/riophae/vue-treeselect/issues/369

# vue-treeselect
[![npm](https://badgen.now.sh/npm/v/@riophae/vue-treeselect)](https://www.npmjs.com/package/@riophae/vue-treeselect) [![Build](https://badgen.now.sh/circleci/github/riophae/vue-treeselect)](https://circleci.com/gh/riophae/vue-treeselect/tree/master) [![Coverage](https://badgen.net/codecov/c/github/riophae/vue-treeselect)](https://codecov.io/gh/riophae/vue-treeselect?branch=master)
![npm monthly downloads](https://badgen.now.sh/npm/dm/@riophae/vue-treeselect)
Expand Down Expand Up @@ -25,7 +30,7 @@
It's recommended to install vue-treeselect via npm, and build your app using a bundler like [webpack](https://webpack.js.org/).

```bash
npm install --save @riophae/vue-treeselect
npm install --save @emacle/vue-treeselect
```

This example shows how to integrate vue-treeselect with your [Vue SFCs](https://vuejs.org/v2/guide/single-file-components.html).
Expand All @@ -40,9 +45,9 @@ This example shows how to integrate vue-treeselect with your [Vue SFCs](https://
<script>
// import the component
import Treeselect from '@riophae/vue-treeselect'
import Treeselect from '@emacle/vue-treeselect'
// import the styles
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import '@emacle/vue-treeselect/dist/vue-treeselect.css'
export default {
// register the component
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "@riophae/vue-treeselect",
"version": "0.4.0",
"name": "@emacle/vue-treeselect",
"version": "0.4.3",
"description": "A multi-select component with nested options support for Vue.js",
"author": "Riophae Lee <[email protected]>",
"license": "MIT",
"homepage": "https://vue-treeselect.js.org/",
"repository": "riophae/vue-treeselect",
"repository": "emacle/vue-treeselect",
"main": "dist/vue-treeselect.cjs.js",
"unpkg": "dist/vue-treeselect.umd.min.js",
"css": "dist/vue-treeselect.min.css",
Expand Down
2 changes: 2 additions & 0 deletions src/components/Input.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
onInput(evt) {
const { value } = evt.target
// 检测输入字符为空时返回,大数据集时防止卡顿
if(!value.trim()) return
this.value = value
Expand Down

0 comments on commit c3a31a4

Please sign in to comment.