Skip to content

Cannot dynamically assign new property to $options object in vue/compat #10626

Closed
@yuwu9145

Description

@yuwu9145

Vue version

3.4.21

Link to minimal reproduction

https://github.com/yuwu9145/vue-compat-options-demo

Steps to reproduce

  1. Run the project using vue compat from reproduction link
  2. Open console and compare the console log result with the vue build one

What is expected?

Results should be the same

What is actually happening?

Cannot assign a new property to $options object when using vue/compat, but it's available in vue build

Screenshot 2024-04-01 at 12 13 01 pm

VS
Screenshot 2024-04-01 at 12 14 28 pm

System Info

System:
    OS: macOS 14.2.1
    CPU: (8) arm64 Apple M1 Pro
    Memory: 158.03 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node
    Yarn: 1.22.21 - ~/.nvm/versions/node/v18.19.0/bin/yarn
    npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm
  Browsers:
    Chrome: 123.0.6312.87
    Safari: 17.2.1
  npmPackages:
    vue: ^3.4.21 => 3.4.21

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions