wip(ssr): basic components

This commit is contained in:
Evan You
2020-02-05 23:07:23 -05:00
parent 27e2e482e9
commit ee5ed73361
20 changed files with 254 additions and 132 deletions

View File

@@ -192,19 +192,21 @@ export function findProp(
if (p.name === name && p.value) {
return p
}
} else if (
p.name === 'bind' &&
p.arg &&
p.arg.type === NodeTypes.SIMPLE_EXPRESSION &&
p.arg.isStatic &&
p.arg.content === name &&
p.exp
) {
} else if (p.name === 'bind' && p.exp && isBindKey(p.arg, name)) {
return p
}
}
}
export function isBindKey(arg: DirectiveNode['arg'], name: string): boolean {
return !!(
arg &&
arg.type === NodeTypes.SIMPLE_EXPRESSION &&
arg.isStatic &&
arg.content === name
)
}
export function hasDynamicKeyVBind(node: ElementNode): boolean {
return node.props.some(
p =>