Skip to content

onServerPrefetch, onBeforeUnmount, and onUnmounted Warnings #2383

Closed Answered by paltman
paltman asked this question in Help
Discussion options

You must be logged in to vote

Figured this out.

My useAutocomplete composable imports ref from 'vue' and therefore using it inside a computed property instead of directly inside the setup "method", I broke the rules.

rewrote:

  const options = computed(() => {
    const { items } = useAutocomplete(query.value, props.kind);
    return items.value;
  });

To return a function that I could wire up to the event to force the requery:

  const { items, reQuery } = useAutocomplete(query.value, props.kind);

  const onQueryChange = ($event: Event) => {
    // Might want to debounce this
    reQuery({ query: ($event.target as HTMLInputElement)?.value });
  };

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paltman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
1 participant