vue的el时哪一个缩写
缩写-自动完成 (Abbreviation-Autocomplete)
A vue.js component that autocompletes abbreviations/acronyms by description rather than the abbreviation text.
一个vue.js组件,可通过描述而不是缩写文本自动完成缩写/缩写。
道具 (Props)
数据 (data)
The autocomplete options
自动完成选项
The options are an array of objects in the form
选项是形式的对象数组
{
a: "Abbreviation or Acronym",
d: "Definition or Description"
}
e.g.
例如
[
{
a: "ATL",
d: "Hartsfield–Jackson Atlanta International Airport"
},
{
a: "LAX",
d: "Los Angeles International Airport"
}
]
限制(可选) (limit(Optional))
The autocomplete results limit Infinity
by default
默认情况下,自动完成结果会限制Infinity
min-input-length(可选) (min-input-length(Optional))
The minimum number of characters typed before autocomplete results are displayed 1 by default
默认情况下,显示自动完成结果之前键入的最少字符数1
例 (Example)
JS (JS)
const autocomplete = new Vue({
el: '#app',
data: {
abbreviations: [
{
a: 'AF',
d: 'Afghanistan'
},
{
a: 'AL',
d: 'Albania'
},
{
a: 'DZ',
d: 'Algeria'
},
{
a: 'AS',
d: 'American Samoa'
},
{
a: 'AD',
d: 'Andorra'
},
{
a: 'AO',
d: 'Angola'
},
{
a: 'AI',
d: 'Anguilla'
},
{
a: 'AQ',
d: 'Antarctica'
},
{
a: 'AG',
d: 'Antigua and Barbuda'
},
{
a: 'AR',
d: 'Argentina'
},
{
a: 'AM',
d: 'Armenia'
},
{
a: 'AW',
d: 'Aruba'
},
{
a: 'AU',
d: 'Australia'
},
{
a: 'AT',
d: 'Austria'
},
{
a: 'AZ',
d: 'Azerbaijan'
}
]
}
})
HTML (HTML)
<abbreviation-autocomplete :data="abbreviations" :limit="10" :min-input-length="2"></abbreviation-autocomplete>
翻译自: https://vuejsexamples.com/a-vue-js-component-that-autocompletes-abbreviations-acronyms/
vue的el时哪一个缩写