mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Use original vue-ssr instead of copy (#3644)
This commit is contained in:
parent
b37855a217
commit
ba7e6c735b
@ -2,35 +2,5 @@
|
||||
** From https://github.com/egoist/vue-no-ssr
|
||||
** With the authorization of @egoist
|
||||
*/
|
||||
export default {
|
||||
name: 'no-ssr',
|
||||
props: ['placeholder'],
|
||||
data () {
|
||||
return {
|
||||
canRender: false
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.canRender = true
|
||||
},
|
||||
render (h) {
|
||||
if (this.canRender) {
|
||||
if (
|
||||
process.env.NODE_ENV === 'development' &&
|
||||
this.$slots.default &&
|
||||
this.$slots.default.length > 1
|
||||
) {
|
||||
throw new Error('<no-ssr> You cannot use multiple child components')
|
||||
}
|
||||
return this.$slots.default && this.$slots.default[0]
|
||||
}
|
||||
|
||||
return h(
|
||||
'div',
|
||||
{
|
||||
class: ['no-ssr-placeholder']
|
||||
},
|
||||
this.$slots.placeholder || this.placeholder
|
||||
)
|
||||
}
|
||||
}
|
||||
import NoSSR from 'vue-no-ssr'
|
||||
export default NoSSR
|
||||
|
@ -121,6 +121,7 @@
|
||||
"vue": "^2.5.17",
|
||||
"vue-loader": "^15.2.6",
|
||||
"vue-meta": "^1.5.2",
|
||||
"vue-no-ssr": "^0.2.2",
|
||||
"vue-router": "^3.0.1",
|
||||
"vue-server-renderer": "^2.5.17",
|
||||
"vue-template-compiler": "^2.5.17",
|
||||
|
@ -7733,6 +7733,10 @@ vue-meta@^1.5.2:
|
||||
lodash.isplainobject "^4.0.6"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
vue-no-ssr@^0.2.2:
|
||||
version "0.2.2"
|
||||
resolved "https://registry.yarnpkg.com/vue-no-ssr/-/vue-no-ssr-0.2.2.tgz#e1a0ef0ba39fc54972edd71a2ae11a7988312b19"
|
||||
|
||||
vue-router@^3.0.1:
|
||||
version "3.0.1"
|
||||
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"
|
||||
|
Loading…
Reference in New Issue
Block a user