Include both node and componentOptions children in lookup
This commit is contained in:
parent
aa21cdf9c3
commit
7d14e70c6e
1 changed files with 3 additions and 2 deletions
|
@ -96,8 +96,9 @@
|
|||
const findOptionsInVNode = (node) => {
|
||||
const opts = node.componentOptions;
|
||||
if (opts && opts.tag.match(optionRegexp)) return [node];
|
||||
if (!node.children) return [];
|
||||
const options = node.children.reduce(
|
||||
if (!node.children && (!opts || !opts.children)) return [];
|
||||
const children = [...(node.children || []), ...(opts && opts.children || [])];
|
||||
const options = children.reduce(
|
||||
(arr, el) => [...arr, ...findOptionsInVNode(el)], []
|
||||
).filter(Boolean);
|
||||
return options.length > 0 ? options : [];
|
||||
|
|
Loading…
Add table
Reference in a new issue