From f28091ed7afedf08ee5c611ed300811be8b64e72 Mon Sep 17 00:00:00 2001 From: "[li_she]" <[li.she@xujiesoft.com]> Date: Thu, 10 Nov 2022 17:17:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=202022=E5=B9=B411=E6=9C=8810=E6=97=A5=20sxm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/common/print-list.vue | 38 +++++++++++++++++++------ 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/views/modules/common/print-list.vue b/src/views/modules/common/print-list.vue index 361f0df..ab1e7be 100644 --- a/src/views/modules/common/print-list.vue +++ b/src/views/modules/common/print-list.vue @@ -16,13 +16,24 @@ - - - + + + + + + + + + + @@ -72,6 +83,17 @@ export default { }) }, methods: { + querySearch(queryString, cb) { + var restaurants = this.printList; + var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants; + // 调用 callback 返回建议列表的数据 + cb(results); + }, + createFilter(queryString) { + return (restaurant) => { + return (restaurant.label.indexOf(queryString) === 0); + }; + }, selectBlur(e){ this.userPrint.printername = e.target.value }, @@ -93,7 +115,7 @@ export default { let list = [] for (let child of children) { let option = { - value: child.index, + value: child.innerText, label: child.innerText } list.push(option)