Merge pull request #2181 from danielpost/dev

Update no-ssr to v0.2.1
This commit is contained in:
Sébastien Chopin 2017-11-21 13:38:25 +01:00 committed by GitHub
commit 8cf56284ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,11 +17,12 @@ export default {
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[0]
return this.$slots.default && this.$slots.default[0]
}
return h('div', { class: { 'no-ssr-placeholder': true } }, this.placeholder)
}