Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
345 views
in Technique[技术] by (71.8m points)

searchbar - Semantic UI Search Bar Category Type Not Working

Can someone please help me or explain it to me in a simple way what am I doing wrong? I′ve been all day searching and studying about this and I can′t find a simple way to make it work. Heres My Code →

    $(document).ready(function () {

           $('.ui.search').search({
       type: 'category', 
       source: categoryContent,
  });
 
var categoryContent = [
 { category: 'South America', title: 'Brazil' },
 { category: 'South America', title: 'Peru' },
 { category: 'North America', title: 'Canada' },
 { category: 'Asia', title: 'South Korea' },
 { category: 'Asia', title: 'Japan' },
 { category: 'Asia', title: 'China' },
 { category: 'Europe', title: 'Denmark' },
 { category: 'Europe', title: 'England' },
 { category: 'Europe', title: 'France' },
 { category: 'Europe', title: 'Germany' },
 { category: 'Africa', title: 'Ethiopia' },
 { category: 'Africa', title: 'Nigeria' },
 { category: 'Africa', title: 'Zimbabwe' },
           ];
       });

When I type something in the Search Bar it shows me the following error:

API action used but no url was defined search {}
API: No URL specified for api event

But why do I need a URL since all my search bar content is from a local VAR??


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...