fix(dynamic components): temporary fix for vue-loader 13.0.0

This commit is contained in:
Pooya Parsa 2017-07-07 02:43:35 +04:30
parent aaf924f49d
commit 9226f606b5
2 changed files with 6 additions and 0 deletions

View File

@ -180,6 +180,8 @@ async function render (to, from, next) {
return Promise.all(promises)
.then(() => {
Object.keys(_this.components).forEach((name) => {
// Sanetize resolved components (Temporary workaround for vue-loader 13.0.0)
_this.components[name] = _this.components[name].default || _this.components[name]
Component.options.components[name] = _this.components[name]
})
})

View File

@ -159,6 +159,10 @@ export default async (context) => {
.then((data) => {
// If not dyanmic component, return data directly
if (Object.keys(_this.components).length === 0) return data
// Sanetize resolved components (Temporary workaround for vue-loader 13.0.0)
Object.keys(_this.components).forEach(name => {
_this.components[name] = _this.components[name].default || _this.components[name]
})
// Tell renderer that dynamic components has been added
context.hasDynamicComponents = true
// Add Component on server side (clone of it)