-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Setup sate don't appear in vue-dev-tool if setup returns render function #1295
Comments
Any updates? |
import { defineComponent, reactive, h } from 'vue'
export default defineComponent({
name: 'SetupRender',
setup () {
const state = reactive({
name: 'Foo bar'
})
return () => {
return h('h1', state.name)
}
}
}) |
This is tricky because the devtools gets the render function as the setup result. |
My suggestion import { defineComponent, ref, h } from 'vue'
import {debug} from '@vue/devtool/debug'
export default defineComponent({
name: 'SetupRender',
setup () {
const name = ref('foo')
debug({
name,
})
return () => {
return h('h1', name.value)
}
}
}) |
My PR for this -> vuejs/core#5383 |
I had the same problem |
Same. As a workaround, I've copied the You use it like so: https://github.com/vuetifyjs/vuetify/blob/next/packages/vuetify/src/components/VApp/VApp.tsx#L25
It works for me |
Just FYI, I stopped using my hack a while ago as I found it to be too cumbersome. It would be great if we could get an official fix :) |
去年就关注了这个问题,今年这个问题有什么进展吗? |
Correct me if I'm wrong, but it looks like this affects any components that use the SFC |
Version
6.0.0-beta.2
Browser and OS info
Chrome 85
Steps to reproduce
Code
What is expected?
setup should appear and have my state which is from my reactive.
What is actually happening?
setup don't appear in vue-dev-tool in Chrome.
if you return state. setup show up after refresh the page. But I need to return my jsx from my component. is there way to fix this issue? Also if you use .vue and flag lang="tsx" it same problem.
The text was updated successfully, but these errors were encountered: