-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
script setup
with extra render
function does not render anything in production mode, but works in dev mode.
#4980
Comments
script setup
with extra render
function does not render anything in production modescript setup
with extra render
function does not render anything in production mode, but works in dev mode.
The fact that it works is a unwanted side-effect of a difference in the dev-behaviour required for debuggability / HMR. We should find some way to warn about this though - the first thing coming to mind would be to throw an error for SFCs using script setup that don't use a . |
Thanks. It may not be a proper space to ask for, but is there any way to use render function with script-setup though? It seems not mentioned from document. |
It's not really meant to be used with render functions, and most of the advantages of
all you are left with is abou 4 lines of boilerplate in the form of: import { defineComponent } from 'vue'
export default {
setup() {
}
} for which in turn you save writing |
Okay. I see. thank you! |
I fixed this because it's a dev/prod behavior inconsistency, but it's non optimal since it requires proxying everything over I think in most cases manual render fn / JSX users should just return therender fn |
…r with script setup close vuejs#4980
@yyx990803 I still need the |
unplugin-vue-macros |
I think it would be helpful if the Vue docs mentioned in the render functions & jsx section here that this is not intended to work with <script setup> syntax. |
Version
3.2.22
Reproduction link
sfc.vuejs.org/
Steps to reproduce
What is expected?
It should render
hello Hello World!
after build.What is actually happening?
No error is reported, but It renders nothing after build. BUT renders
hello Hello World!
in dev mode (you may use the download button on sfc playground and try it).The text was updated successfully, but these errors were encountered: