vsyswin-ui 0.2.94 → 0.2.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vsyswin-ui",
3
- "version": "0.2.94",
3
+ "version": "0.2.96",
4
4
  "main": "lib/vsyswin-ui.umd.min.js",
5
5
  "private": false,
6
6
  "description": "Vue2.x的应用组件库.",
@@ -8,10 +8,13 @@
8
8
  type="text"
9
9
  v-model.trim="keyword"
10
10
  class="query-input"
11
+ ref='queryInputRef'
11
12
  :placeholder="placeholder"
13
+ @compositionstart="typing=true"
14
+ @compositionend="onCompositionEnd"
12
15
  @focus="onQueryInputFocus"
13
16
  @blur="onQueryInputBlur"
14
- @input="onSearchTree"
17
+ @input="onInput"
15
18
  />
16
19
  </div>
17
20
  </div>
@@ -94,6 +97,7 @@ export default {
94
97
  searchIsActive: false,
95
98
  ztreeId: 'ztree_' + parseInt(Math.random() * 1e10),
96
99
  ztreeObj: null,
100
+ typing: false,
97
101
  ztreeSetting: {
98
102
  view: {
99
103
  showIcon: true // default to hide icon
@@ -186,6 +190,7 @@ export default {
186
190
  // 如果是搜索展开所有
187
191
  this.ztreeObj.expandAll(true)
188
192
  }
193
+ this.$refs.queryInputRef.focus()
189
194
  })
190
195
  },
191
196
  deep: true,
@@ -201,9 +206,19 @@ export default {
201
206
  // 搜索框失去焦点
202
207
  this.searchIsActive = false
203
208
  },
209
+ onCompositionEnd() {
210
+ this.typing = false
211
+ this.onSearchTree()
212
+ },
213
+ onInput() {
214
+ // 正在输入中文时就不执行后面的代码
215
+ if (this.typing) return
216
+ this.onSearchTree()
217
+ },
204
218
  onSearchTree: debounce(200, function() {
205
219
  // 根据关键字搜索树
206
220
  this.$emit('searchTree', this.keyword)
221
+ this.$refs.queryInputRef.focus()
207
222
  }),
208
223
  setSelectedNode(selectedKey, noEmit) {
209
224
  // 设置默认选中的节点