Data Option breaking

    • BREAKING: component option declaration no longer accepts a plain JavaScript object and expects a function declaration.

    For example:

    In 3.x, the data option has been standardized to only accept a that returns an object.

    1. import { createApp } from 'vue'
    2. createApp({
    3. data() {
    4. }
    5. }
    6. }).mount('#app')
    7. </script>

    For users relying on the object declaration, we recommend:

    • Extracting the shared data into an external object and using it as a property in data