From ba7e6c735bdd2e179d111bd63b7eec9da0741465 Mon Sep 17 00:00:00 2001 From: HANATANI Takuma Date: Tue, 7 Aug 2018 09:58:33 +0900 Subject: [PATCH] Use original vue-ssr instead of copy (#3644) --- lib/app/components/no-ssr.js | 34 ++-------------------------------- package.json | 1 + yarn.lock | 4 ++++ 3 files changed, 7 insertions(+), 32 deletions(-) diff --git a/lib/app/components/no-ssr.js b/lib/app/components/no-ssr.js index 8f400536ea..db65103194 100644 --- a/lib/app/components/no-ssr.js +++ b/lib/app/components/no-ssr.js @@ -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(' 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 diff --git a/package.json b/package.json index 3c39627389..0e90d0535f 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/yarn.lock b/yarn.lock index f3a6fdef5e..096b69db70 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"