Created
December 6, 2017 02:03
-
-
Save aloha1003/0d1d8606b24efe74530674330ba53f61 to your computer and use it in GitHub Desktop.
question-code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My Template : | |
<f7-list form> | |
<f7-list-item> | |
<f7-label>Fruit</f7-label> | |
<f7-input type="text" placeholder="Fruit" :id="'autocomplete-dropdown-expand'+_uid"></f7-input> | |
</f7-list-item> | |
</f7-list> | |
methods: | |
initAutoComplete: function() { | |
let self = this; | |
var autocompleteDropdownExpand = self.$f7.autocomplete({ | |
input: '#autocomplete-dropdown-expand'+self._uid, | |
openIn: 'dropdown', | |
expandInput: true, // expand input | |
source: function (autocomplete, query, render) { | |
var results = []; | |
if (query.length === 0) { | |
render(results); | |
return; | |
} | |
// Find matched items | |
for (var i = 0; i < fruits.ength; i++) { | |
if (fruits[i].toLowerCase().indexOf(query.toLowerCase()) >= 0) results.push(fruits[i]); | |
} | |
// Render items by passing array with result items | |
render(results); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment