feat(compiler): add isNativeTag option for determining element type (#139)

This commit is contained in:
月迷津渡
2019-10-11 02:54:06 +08:00
committed by Evan You
parent 46d875f4e8
commit 78f60347dc
7 changed files with 275 additions and 13 deletions

View File

@@ -110,10 +110,9 @@ export function createAppAPI<HostNode, HostElement>(
return app
},
component(name: string, component?: Component) {
// TODO component name validation
component(name: string, component?: Component): any {
if (!component) {
return context.components[name] as any
return context.components[name]
} else {
context.components[name] = component
return app