fix(parse-component): parse ArrayExpression

This commit is contained in:
Eric Liu 2020-10-17 13:51:32 -07:00
commit 77ebd0d1aa
4 changed files with 43 additions and 14 deletions

View file

@ -44,7 +44,10 @@ export function parseComponent(source, hooks) {
let description = null;
if (init != null) {
if (init.type === "ObjectExpression") {
if (
init.type === "ObjectExpression" ||
init.type === "ArrayExpression"
) {
value = source.slice(init.start, init.end).replace(/\n/g, " ");
type = value;
} else {