<template>
<el-select
v-model="value"
multiple
filterable
remote
reserve-keyword
placeholder="请输入关键词"
:remote-method="remoteMethod"
:loading="loading">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<script>
export default {
data() {
return {
options: [],
value: [],
list: [],
loading: false,
states: ["Alabama", "Alaska", "Arizona",
"Arkansas", "California", "Colorado",
"Connecticut", "Delaware", "Florida",
"Georgia", "Hawaii", "Idaho", "Illinois",
"Indiana", "Iowa", "Kansas", "Kentucky",
"Louisiana", "Maine", "Maryland",
"Massachusetts", "Michigan", "Minnesota",
"Mississippi", "Missouri", "Montana",
"Nebraska", "Nevada", "New Hampshire",
"New Jersey", "New Mexico", "New York",
"North Carolina", "North Dakota", "Ohio",
"Oklahoma", "Oregon", "Pennsylvania",
"Rhode Island", "South Carolina",
"South Dakota", "Tennessee", "Texas",
"Utah", "Vermont", "Virginia",
"Washington", "West Virginia", "Wisconsin",
"Wyoming"]
}
},
mounted() {
this.list = this.states.map(item => {
return { value: `value:${item}`, label: `label:${item}` };
});
},
methods: {
remoteMethod(query) {
if (query !== '') {
this.loading = true;
setTimeout(() => {
this.loading = false;
this.options = this.list.filter(item => {
return item.label.toLowerCase()
.indexOf(query.toLowerCase()) > -1;
});
}, 200);
} else {
this.options = [];
}
}
}
}
</script>
select远程搜索
原创152LvBigGrandPa ©著作权
文章标签 ico Jersey 文章分类 JavaScript 前端开发
上一篇:Cascader可清空选项
下一篇:slider滑块样式
-
Oceanbase为啥新入数据select慢
oceanbase运维,it小白,OB数据库
数据库 数据 MySQL Oceanbase -
搜索select
灵活自如。
php 编程 -
ios低版本 select 远程搜索 ios远程调试
* 注意:您需要升级到Safari 6.0版才能启用此功能。*随着iOS6的最新发布,苹果终于推出了一款用于在iOS设备上调试Web应用程序的远程Web检查器。启用它很简单,但它被埋在手机上的几个选项。在设备上,前往设置 > Safari > 高级你会发现Web Inspector在那里切换。启用后,您需要将iPhone或iPad物理连
ios低版本 select 远程搜索 Safari 调试iOS js Web Inspector -
jquery 远程搜索 jquery搜索框
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-U
jquery 远程搜索 JS搜索文字框效果 jqyery焦点案例 JS移入移出回车提交 html -
带搜索的select jQuery
经常使用Win10电脑的人,很多人都知道:Windows 10操作系统上有一款名叫“便笺”的小工具,在它上面记事备忘提供方便的!另外,Win10便签还有“搜索”功能,支持用户输入关键词查找便签内容,更人性化!看到这里,可能很多正在使用Win7电脑办公的小伙伴,心里就很不高兴了。因为Win7电脑上虽然也有系统自带的便签小工具,但是Win7便签却没有搜索功能。那么,在Win7电脑上如果想搜索查找便签记
带搜索的select jQuery win10便签常驻桌面 win10桌面便签 win7小工具打不开 电脑记事本