renderState() — vue Function Reference
Architecture documentation for the renderState() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 2db55f9f_d6b9_466e_41e7_5872bfa09b6d["renderState()"] d00ee0bd_5dce_cc55_ebbd_75e9b4ae547b["render()"] d00ee0bd_5dce_cc55_ebbd_75e9b4ae547b -->|calls| 2db55f9f_d6b9_466e_41e7_5872bfa09b6d ec23851e_5b87_f9fb_e085_226ff2e53a15["_flush()"] ec23851e_5b87_f9fb_e085_226ff2e53a15 -->|calls| 2db55f9f_d6b9_466e_41e7_5872bfa09b6d style 2db55f9f_d6b9_466e_41e7_5872bfa09b6d fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/server-renderer/src/template-renderer/index.ts lines 227–241
renderState(
context: Record<string, any>,
options?: Record<string, any>
): string {
const { contextKey = 'state', windowKey = '__INITIAL_STATE__' } =
options || {}
const state = this.serialize(context[contextKey])
const autoRemove = __DEV__
? ''
: ';(function(){var s;(s=document.currentScript||document.scripts[document.scripts.length-1]).parentNode.removeChild(s);}());'
const nonceAttr = context.nonce ? ` nonce="${context.nonce}"` : ''
return context[contextKey]
? `<script${nonceAttr}>window.${windowKey}=${state}${autoRemove}</script>`
: ''
}
Domain
Subdomains
Source
Frequently Asked Questions
What does renderState() do?
renderState() is a function in the vue codebase.
What calls renderState()?
renderState() is called by 2 function(s): _flush, render.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free