-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.🐞 bugSomething isn't workingSomething isn't working
Description
Version
3.1.1
Reproduction link
https://codesandbox.io/s/sleepy-frog-2zshk?file=/src/components/HelloWorld.vue:243-292
Steps to reproduce
Open the reproduction and you can see the error message in the console right after.
What is expected?
It's supposed to display
Hello Vue in CodeSandbox!
Component name: HelloWorld
That "HelloWorld" is supposed to come from this.$options.name
.
What is actually happening?
this
is undefined and it throws an error.
According to the latest version of apiInject.ts
, defaultValue
function is called without this
binding. It should've been defaultValue.call(instance)
.
The same example works fine with Vue2.
https://codesandbox.io/s/purple-waterfall-hutku?file=/src/components/HelloWorld.vue:235-270
If it's not intended, I could open a PR for fix.
Metadata
Metadata
Assignees
Labels
❗ p4-importantPriority 4: this fixes bugs that violate documented behavior, or significantly improves perf.Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.🐞 bugSomething isn't workingSomething isn't working