Skip to content

Commit

Permalink
bug fixes; make sample data prettier; (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekulish authored and darrenjennings committed Nov 6, 2017
1 parent f8df22f commit 8a8f177
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
35 changes: 17 additions & 18 deletions docs/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,19 @@ export default {
return {
selected: "",
limit: 10,
options: [
],
options: [],
sectionConfigs: {
"default": {
default: {
limit: 6,
onSelected: function(item) {
alert('default: ' + item.label)
alert("default: " + item.label);
}
},
"blog": {
blog: {
limit: 3,
type: 'url-section',
type: "url-section",
onSelected: function(item) {
alert('url: ' + item.item.url);
alert("url: " + item.item.url);
}
}
},
Expand All @@ -54,8 +53,9 @@ export default {
},
methods: {
onInputChange(text) {
this.filteredOptions = [{
"data": [
this.filteredOptions = [
{
data: [
"clifford kits",
"friendly chemistry",
"phonics",
Expand All @@ -75,19 +75,18 @@ export default {
"lego",
"math life of fred",
"multiplication",
"thinking tree"
"thinking tree"
]
},
{
"label": "Blog",
"name": "blog",
"data": [
{"url": "http://bla.com/1", "value":"blog link 1"},
{"url": "http://bla.com/2", "value":"blog link 2"},
{"url": "http://bla.com/3", "value":"blog link 3"},
{"url": "http://bla.com/4", "value":"blog link 4"}
label: "Blog",
name: "blog",
data: [
{ url: "https://blog.educents.com/best-educational-games-2017-inchimals/", value: "The Best Educational Games and Toys of 2017: Inchimals" },
{ url: "https://blog.educents.com/reading-exploring-world-through-literature/", value: "Family Read-Alouds: Exploring the World Through Literature" }
]
}]
}
];
}
}
};
Expand Down
1 change: 1 addition & 0 deletions src/Autosuggest.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ export default {
this.computedSize = 0;
this.suggestions.forEach(section => {
if (!section.data) return;
const n = this.getSectionName(section);
var t;
if (this.sectionConfigs[n] && this.sectionConfigs[n].type) {
Expand Down

0 comments on commit 8a8f177

Please sign in to comment.