mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +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
|
** From https://github.com/egoist/vue-no-ssr
|
||||||
** With the authorization of @egoist
|
** With the authorization of @egoist
|
||||||
*/
|
*/
|
||||||
export default {
|
import NoSSR from 'vue-no-ssr'
|
||||||
name: 'no-ssr',
|
export default NoSSR
|
||||||
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
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -121,6 +121,7 @@
|
|||||||
"vue": "^2.5.17",
|
"vue": "^2.5.17",
|
||||||
"vue-loader": "^15.2.6",
|
"vue-loader": "^15.2.6",
|
||||||
"vue-meta": "^1.5.2",
|
"vue-meta": "^1.5.2",
|
||||||
|
"vue-no-ssr": "^0.2.2",
|
||||||
"vue-router": "^3.0.1",
|
"vue-router": "^3.0.1",
|
||||||
"vue-server-renderer": "^2.5.17",
|
"vue-server-renderer": "^2.5.17",
|
||||||
"vue-template-compiler": "^2.5.17",
|
"vue-template-compiler": "^2.5.17",
|
||||||
|
@ -7733,6 +7733,10 @@ vue-meta@^1.5.2:
|
|||||||
lodash.isplainobject "^4.0.6"
|
lodash.isplainobject "^4.0.6"
|
||||||
object-assign "^4.1.1"
|
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:
|
vue-router@^3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"
|
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"
|
||||||
|
Loading…
Reference in New Issue
Block a user