Semantic-UI 搜索本地类别类型
Semantic UI开源框架提供图标或字形,用于显示与某些元素相关的图片,使用 CSS 和 jQuery,用于创建出色的用户界面。它是一个用于创建漂亮和响应式布局的开发框架。
语义 UI 搜索用于允许用户在网站上搜索不同的内容。搜索可以帮助搜索博客、工具、其他链接等。语义UI搜索本地类别类型是一种可以从静态本地数据中搜索类别的搜索类型。
语义 UI 搜索本地类别类型选项:
- type:我们需要将类别选项传递给该选项以启用类别搜索。
- source:这里我们需要传递数据源。
句法:
将类型和来源添加到 Search for Local Category 类型,如下所示:
$('.ui.search').search({ type: 'category', source: categoryTutorials, })
数据源应该如下:
var categoryTutorials = [ { category: 'Algorithms', title: 'Searching Algorithms' }, { category: 'Algorithms', title: 'Sorting Algorithms' }, { category: 'Algorithms', title: 'Graph Algorithms' }, ]
示例:在下面的示例中,我们有本地类别搜索类型的搜索,以从本地数据中搜索。
HTML
Semantic-UI Search Local Category Type
GeeksforGeeks
Semantic UI Search Local Category Type
Welcome to GeeksforGeeks
Find the best programming tutorials here.
输出
参考: https ://semantic-ui.com/modules/search.html#local-category-search