@@ -261,6 +261,7 @@ const tagNatives = {
261261 }
262262 } ,
263263 component : {
264+ supportCard : true ,
264265 excludeRoot : true ,
265266 attrs : {
266267 extendCommon : false , // 不支持通用属性
@@ -1827,15 +1828,17 @@ function checkCustomDirective(name, value, output, node) {
18271828function checkAttr ( name , value , output , tagName , locationInfo , options ) {
18281829 if ( name && isValidValue ( value ) ) {
18291830 if ( shouldConvertPath ( name , value , tagName ) ) {
1830- // 判断路径下资源是否存在
1831- const hasFile = fileExists ( value , options . filePath )
1832- if ( ! hasFile ) {
1833- output . log . push ( {
1834- line : locationInfo . line ,
1835- column : locationInfo . column ,
1836- reason :
1837- 'WARN: ' + tagName + ' 属性 ' + name + ' 的值 ' + value + ' 下不存在对应的文件资源'
1838- } )
1831+ if ( ! exp . isExpr ( value ) ) {
1832+ // 若路径不包含表达式,判断路径下资源是否存在
1833+ const hasFile = fileExists ( value , options . filePath )
1834+ if ( ! hasFile ) {
1835+ output . log . push ( {
1836+ line : locationInfo . line ,
1837+ column : locationInfo . column ,
1838+ reason :
1839+ 'WARN: ' + tagName + ' 属性 ' + name + ' 的值 ' + value + ' 下不存在对应的文件资源'
1840+ } )
1841+ }
18391842 }
18401843 // 转换为以项目源码为根的绝对路径
18411844 value = resolvePath ( value , options . filePath )
@@ -2017,5 +2020,6 @@ export default {
20172020 getTagChildren,
20182021 isSupportedSelfClosing,
20192022 isEmptyElement,
2020- isNotTextContentAtomic
2023+ isNotTextContentAtomic,
2024+ isExpr : exp . isExpr
20212025}
0 commit comments