Skip to content

applyMatchesUpdates does not update div in Vue? #20

Description

@OleVoss

I use bracketry in a Vue component like this:

<script>
const props = defineProps<{
    stageId: string | number;
    knockoutStandings: KnockoutStandings;
}>();

const bracket = ref();
onMounted(() => {
    const wrapper = document.querySelector('#bracketry-wrapper');
    if (wrapper) {
        bracket.value = createBracket(data, wrapper, options);
        console.log(bracket.value);
    }
});
</script>

<template>
    <div class="h-full w-full p-4" id="bracketry-wrapper"></div>
</template>

It is working as expected. But, I also use echo to listen to real-time updates to the standings:

useEcho<{ standings: KnockoutStandings }>(`stages.${props.stageId}.standings`, 'StageStandingsUpdate', (e) => {
    const newMatches = getMatchesFromStandings(e.standings);
    bracket.value.applyMatchesUpdates(newMatches);
});

I do get these updates, but when applied, nothing changes. Do you have any idea what I am missing? This could be something within Vue etc. as I am fairly new to the framework.

As these updates are not occuring that oftern, I could also just recreate the component on every update but I would like to avoid that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions