1.0.7 • Published 7 years ago

autocomplete-vue-lacateam v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

autocomplete-vue-lacateam

AutoComplete VueJs 2

Installation

$ npm install --save autocomplete-vue-lacateam

Example

import autocomplete from 'autocomplete-vue-lacateam'
    
new Vue({
  el: '#app',,
  components: { autocomplete },
  data () {
    return {
      url: '/searchusers',
      limit: 4,
      placeholder: 'Name|Email',
      bgcolorselect: '#000000'
    }
  },
  methods: {
    callbackdata (data) {            
      console.log(data);
      // data : return data clicked
    }
  }
})
<body id="app">
  <autocomplete 
  url="url" 
  placeholder="placeholder" 
  limit="5"
  :callbackdata="callbackdata" 
  bgcolorselect="bgcolorselect">
   <template scope="item">
      <h4>{{ item.text.name }}</h4>
      <p>{{ item.text.email }}</p>
      <!--default template
         <h4>{{item.value?item.value:item.name}}</h4>
      -->
    </template>
  </autocomplete>
</body>

Props

NameTypeDefaultRequiredDescription
urlStringtrueTotal itens in server side
callbackdataFunctiontrueReturns the selected result
Options
NameStringDefaultDescription
bgcolorselectString"#650065"Background Color when select and focus data
placeholderString"Search"PlaceHolder
limitString"3"Limit
fielddatashowString"name"Data show in input
startString"3"Keyword length to start searching
iconString"glyphicon glyphicon-search text-muted"icon of the input control
iconleftString"false"By default, the icon on the right is equivalent to inconleft = "true"
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago