diff options
Diffstat (limited to 'node_modules/vuepress/lib/app/components/ClientOnly.js')
| -rw-r--r-- | node_modules/vuepress/lib/app/components/ClientOnly.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/node_modules/vuepress/lib/app/components/ClientOnly.js b/node_modules/vuepress/lib/app/components/ClientOnly.js new file mode 100644 index 00000000..c786d1af --- /dev/null +++ b/node_modules/vuepress/lib/app/components/ClientOnly.js @@ -0,0 +1,12 @@ +export default { + functional: true, + render (h, { parent, children }) { + if (parent._isMounted) { + return children + } else { + parent.$once('hook:mounted', () => { + parent.$forceUpdate() + }) + } + } +} |
