Vue中-下拉框可以选择可以填写


                            
                                
                            
                        

// 方法
            querySearchMethod(queryString, cb) {
                let that = this;
                var solList = []
                that.MethodOptionItems.forEach(item => {
                    solList.push({ 'label': item.value, 'value': item.label })
                })

                var results = queryString
                    ? solList.filter(this.createFilterMethod(queryString))
                    : solList;
                // 调用 callback 返回建议列表的数据
                cb(results);
            },
            createFilterMethod(queryString) {
                let that = this;
                var solList = that.MethodOptionItems;
                return solList => {
                    return (
                        //solList.label.toLowerCase().indexOf(queryString.toLowerCase()) === 0
                        solList.label
                    );
                };
            },
            handleSelectMethod(item) {
                console.log(item);
            },

 

你可能感兴趣的:(Vue)