如何为AutoSuggest加载数据

发布于 2025-01-18 09:35:29 字数 146 浏览 2 评论 0原文

我正在构建一个笔记应用程序,您可以在其中添加标签。当用户开始添加新标签时,我想从其以前保存的所有标签中自动使用标签。 我该如何实施? 我是否请求用户的所有先前保存的注释,获取标签并将其与用户键入的内容进行比较,还是在用户添加注释时维护标签集合? 什么是正确的方法,我们如何决定?

I am building a note-taking app where you can add tags to notes. When a user starts adding a new tag, I want to autosuggest the tag from all of its previous saved tags.
How do I implement that?
Do I request for the user's every previously saved notes, get tags and compare them with what the user is typing or do I maintain a collection of tags when the user is adding a note?
What is the correct approach and how do we decide?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花开半夏魅人心 2025-01-25 09:35:30

您有 2 个选项:

  1. 为标签创建一个单独的集合,并在标签上包含用户 ID。
  2. 将用户搜索的标签存储在本地存储中,并在页面上加载检索
    所有标签,并用它进行搜索。

You have 2 options:

  1. Create a separate collection for tags, with the user id on them.
  2. Store user searched tags on local storage, and on the page, load retrieve
    all the tags, and search with it.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文