Skip to content

Commit

Permalink
Merge pull request #1521 from didi/fix-range-default-components
Browse files Browse the repository at this point in the history
feat: range 处理后置在 postProcessComponentIs 中
  • Loading branch information
hiyuki authored Jul 1, 2024
2 parents 87957d3 + fefb63c commit 23af2c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/webpack-plugin/lib/template-compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -964,8 +964,12 @@ function processComponentIs (el, options) {
return
}

const isInRange = makeMap(getAndRemoveAttr(el, 'range').val || '')
el.components = (options.usingComponents || []).filter(i => isInRange(i))
const range = getAndRemoveAttr(el, 'range').val
const isInRange = makeMap(range || '')
el.components = (options.usingComponents || []).filter(i => {
if (!range) return true
return isInRange(i)
})
if (!el.components.length) {
warn$1('Component in which <component> tag is used must have a non blank usingComponents field')
}
Expand Down

0 comments on commit 23af2c3

Please sign in to comment.