test: basic 2.x compat test case

This commit is contained in:
Evan You
2018-09-19 23:43:27 -04:00
parent b3208a5941
commit 232d14c0dd
3 changed files with 41 additions and 2 deletions

View File

@@ -183,6 +183,11 @@ export function createComponentClassFromOptions(
set: isGet ? undefined : value.set
})
}
if (key === 'methods') {
for (const method in value) {
;(ObjectComponent.prototype as any)[method] = value[method]
}
}
}
return ObjectComponent as ComponentClass
}