Skip to content

Missing breaking change: Option API does not have access to exposed properties anymore #66

Open
@dorian-marchal

Description

This component worked as expected in Vue 2.7.16 but fails with TypeError: this.getFoo is not a function in Vue 3.4.23:

<template>
    <pre>
        {{ foo }}
    </pre>
</template>

<script setup>
function getFoo() {
    return 'foo'
}
defineExpose({ getFoo })
</script>

<script>
export default {
    computed: {
        foo() {
            return this.getFoo()
        },
    },
}
</script>

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions