v3-migration-guide icon indicating copy to clipboard operation
v3-migration-guide copied to clipboard

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

Open dorian-marchal opened this issue 8 months ago • 0 comments

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>

dorian-marchal avatar May 29 '24 15:05 dorian-marchal