Skip to content

Trying to get "board" from "boards" use Pinia getter and receive undefined #1860

Discussion options

You must be logged in to vote

I found a solution, maybe not the best one, but it's work:

onMounted(async () => {
  await boardStore.fetchBoards();

  setBoardName();
});

watch(
  () => boardStore.activeBoardId,
  () => setBoardName()
);

const setBoardName = () => {
  const board = computed(() => boardStore.getBoardById(boardStore.activeBoardId));

  resetForm({
    values: {
      name: board.value.name,
    },
  });
};

Replies: 1 comment

Comment options

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