-
Notifications
You must be signed in to change notification settings - Fork 345
When i use setup function in vue2 project i get some error in console #693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you mind provide a repository with reproducible code? The code you provided relies heavily on code that's not provided. |
This is my first time new an issue,dont know too much about the issue standard so the reply looks a little messy. My english is so bad :( . I hope this can help <3 |
I created a repo to reproduce this issue, this issue is cause by the flowing code: import { getCurrentInstance } from '@vue/composition-api'
export default {
name: 'App',
setup() {
const { proxy } = getCurrentInstance()
return { proxy }
}
} |
@SKADaddy Use it like below, will work fine.
|
@xinpingwang if destruct the |
@SKADaddy Don't know how you want to use the proxy. In my sense:
|
@ygj6 but if i want to use |
I tracked the call stack, and find the the cause of this issue. the returned and inner Lines 119 to 137 in 7955e28
then Line 184 in 7955e28
inner composition-api/src/reactivity/reactive.ts Lines 9 to 11 in 7955e28
since Don't this issue should fix in vuejs/vue or this project. @pikax Any suggestion? |
it show this error in console

and if my getList,resetSearch,exportExcel these 3 function return at the end.Vue will warn
but if i put them at the beginning like this,it will be fine
but the

[Vue warn]: Error in data(): "TypeError: Cannot use 'in' operator to search for '__ob__' in undefined"
error still show up in the consoleThe text was updated successfully, but these errors were encountered: