Use original vue-ssr instead of copy (#3644)

This commit is contained in:
HANATANI Takuma 2018-08-07 09:58:33 +09:00 committed by Sébastien Chopin
parent b37855a217
commit ba7e6c735b
3 changed files with 7 additions and 32 deletions

View File

@ -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

View File

@ -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",

View File

@ -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"