Script Setup Does Not Populate Name Property
Vue version
3.4.19
Link to minimal reproduction
Steps to reproduce
Go to the link, open the debugger, and notice that the instance does not have the name
property set.
What is expected?
The instance's name
property is set.
What is actually happening?
I know that __name
gets set, but that's not listed in the docs as something we can use, so it seems like it's an internal, private value that we should not be using.
System Info
Firefox
Any additional comments?
I also know that I can use defineOptions
to set the name, but I don't want to have to remember to do this across all my files. This seems like it might be the opposite of https://github.com/vuejs/core/issues/6357
This is expected behavior. The inferred name is added as an internal option because otherwise it would result in backwards-incompatible behavior (see https://github.com/vuejs/core/commit/9734b31c312244a2b5c5cf83c75d7b34076a0c4b)