如何在 Angular 6 中使用 select2?

编程入门 行业动态 更新时间:2024-10-21 09:46:17
本文介绍了如何在 Angular 6 中使用 select2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我需要在 angular 6 中使用select2"来自动完成.谁以前用过?,请帮帮我.

I need to use "select2" in angular 6 for autocomplete. Who's ever use it before? , help me please.

推荐答案

以防万一其他人来到这里.Select2 有很多角度包装器的分支,但它们都很大,并且还需要 JQuery (1.32MB) 和 Select2 (839kB).

Just in case anyone else landed here. There are lots of forks of angular wrappers for Select2 but they all sizeable and also require both JQuery (1.32MB) and Select2 (839kB).

如果您对没有任何依赖项的纯 Angular 的 Select2 的简化克隆感兴趣,您可以尝试这个:

If you are interested in a simplified clone of Select2 in pure angular without any dependencies you could try this one:

https://github/timbophillips/angular-components-workspace/tree/master/projects/filtered-select

https://www.npmjs/package/filtered-select

花里胡哨要少得多,但就我而言,我真的只想要可搜索的选择控件.

Far fewer bells and whistles but for my purposes I really just want the searchable select control.

将其安装为 npm 模块 (16.2kB) 或使用源代码.它在没有 Ivy 的情况下编译,所以它应该适用于旧的和新的 angular 项目.

Install it as an npm module (16.2kB) or use the source code. Its compiled without Ivy so it should work on old and new angular projects.

这篇关于如何在 Angular 6 中使用 select2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-22 16:34:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1027006.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   Angular

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!