From 523e2c81fdea4df923238fe1650a09a1640aa037 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Thu, 3 May 2018 07:03:46 +0200 Subject: [PATCH] correct match logic for i-option and Option --- src/components/select/select.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/select/select.vue b/src/components/select/select.vue index 00318fa..f3258af 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -80,7 +80,8 @@ import FunctionalOptions from './functional-options.vue'; const prefixCls = 'ivu-select'; - const optionGroupRegexp = /option\-?group/i; + const optionRegexp = /^i-option$|^Option$/; + const optionGroupRegexp = /option-?group/i; const findChild = (instance, checkFn) => { let match = checkFn(instance); @@ -94,7 +95,7 @@ const findOptionsInVNode = (node) => { const opts = node.componentOptions; - if (opts && opts.tag === 'Option') return [node]; + if (opts && opts.tag.match(optionRegexp)) return [node]; if (!node.children) return []; const options = node.children.reduce( (arr, el) => [...arr, ...findOptionsInVNode(el)], [] -- libgit2 0.21.4