Fix class component typeerror when using nuxt1.0.0-alpha

This commit is contained in:
Clark Du 2017-05-23 17:04:44 +08:00
parent b2ef8c320f
commit e4e0711de2

View File

@ -52,7 +52,7 @@ export default async (context) => {
let Components = []
let promises = getMatchedComponents(router.match(context.url)).map((Component) => {
return new Promise((resolve, reject) => {
if (typeof Component !== 'function') return resolve(sanitizeComponent(Component))
if (typeof Component !== 'function' || Component.super === Vue) return resolve(sanitizeComponent(Component))
const _resolve = (Component) => resolve(sanitizeComponent(Component))
Component().then(_resolve).catch(reject)
})