Skip to content

component is accessible by this from function declared in <script setup> on dev mode #6822

Open
@sapphi-red

Description

@sapphi-red

Vue version

3.2.40

Link to minimal reproduction

https://sfc.vuejs.org/#__DEV__eNqNkc9uwjAMxl/FygUQNEHbTqhM7D1yKWkKGc0fJQ7TVPXd57QcgEnTbrH92T/7y8A+QuDXrNmO1UlFExCSxhzepTM2+IgwQNQdjNBFb2FB0oV00invEoLy2SHsi2K5XZV8l51C4x103i9XMEgHpHLJ95r3/rTEs0l8aiP5KF0tZirxKEBtQ9+gpgigbs0VVN+ktJdMNbGVbMpT5ZgRiYHfQVNtjiSDg+qNuhR1AazX1DBvaBIMw23bcazF3PHfadMpNMtnDPl29MOMWtCq9KrF3QFsw2YHK9sE/pm8I48nP+StkCTbzQ6VHDlbYsnOiCHthMguXE7klRUHqolIVGN11Xp7eOUv/G1L1IT3ea6TrY7RfyUdiSjZ5m64oORVxypq1+qo45+wJ+0D8Kn2C1qY9LMjG38AeufSrA==

Steps to reproduce

  1. Open reproduction
  2. Click output count button

Note that @click="foo()" is using foo(). It work well when this is @click="foo".

What is expected?

Cannot read properties of undefined (reading 'count') error happen on dev too. (it happens on prod)

What is actually happening?

0 will be shown in console on dev

System Info

No response

Any additional comments?

original issue: vitejs/vite#3872

Metadata

Metadata

Assignees

No one assigned

    Labels

    🍰 p2-nice-to-havePriority 2: this is not breaking anything but nice to have it addressed.🐞 bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions