作者:最低调的鹌鹑 | 来源:互联网 | 2024-11-07 10:27
// 邮箱自动填充后缀名querySearchEmail(queryString, callback) { const emailList = [ { value: '@qq.co
v-model="form.user.email"
:fetch-suggestiOns="querySearchEmail"
:trigger-on-focus="false"
placeholder="接收邮件邮箱"
>
// 邮箱自动填充后缀名
querySearchEmail(queryString, callback) {
const emailList = [
{ value: '@qq.com' },
{ value: '@126.com' },
{ value: '@163.com' },
{ value: '@sina.com' },
{ value: '@21cn.com' },
{ value: '@sohu.com' },
{ value: '@yahoo.com.cn' },
{ value: '@tom.com' },
{ value: '@etang.com' },
{ value: '@eyou.com' },
{ value: '@56.com' },
{ value: '@x.cn' },
{ value: '@chinaren.comsogou.com' },
{ value: '@citiz.com' },
]
let results = []
let queryList = []
emailList.map(item => {
queryList.push({ value: queryString.split('@')[0] + item.value })
})
results = queryString ? queryList.filter(this.createFilter(queryString)) : queryList;
callback(results);
},
// 邮箱填写过滤
createFilter(queryString) {
return (item) => {
return (item.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
};
},