Skip to content

Reactive useFluent() #908

Answered by niusia-ua
niusia-ua asked this question in Q&A
Jan 23, 2025 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

I investigated that the UI framework I use supports getter functions in the label definition that makes them reactive.

  const menuOptions = ref<MenuItem[]>([
    {
      label: () => fluent.$t("file"),
      items: [
        { label: () => fluent.$t("open") },
        { label: () => fluent.$t("create") },
        { label: () => fluent.$t("save") },
        { label: () => fluent.$t("close") },
      ],
    },
  ]);

If this is the correct usege of useFluent(), then I will close the discussion.
Sorry for bothering you.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Demivan
Comment options

@niusia-ua
Comment options

Answer selected by Demivan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants