diff --git a/packages/hap-compiler/src/template/validator.js b/packages/hap-compiler/src/template/validator.js index c0e073c9..bdb87992 100644 --- a/packages/hap-compiler/src/template/validator.js +++ b/packages/hap-compiler/src/template/validator.js @@ -1864,12 +1864,7 @@ function checkAttr(name, value, output, tagName, locationInfo, options) { * @returns {boolean} */ function shouldConvertPath(name, value, tagName) { - const skip = name === 'alt' && value === 'blank' - if (skip) { - return false - } - - if (['src', 'alt'].includes(name) && value && ['img', 'video'].indexOf(tagName) > -1) { + if (['src'].includes(name) && value && ['img', 'video'].indexOf(tagName) > -1) { if (!/^(data:|http|{{)/.test(value)) { return true } diff --git a/packages/hap-dsl-xvm/test/unit/ux/__snapshots__/component.test.js.snap b/packages/hap-dsl-xvm/test/unit/ux/__snapshots__/component.test.js.snap index 95ac40b7..776fd654 100644 --- a/packages/hap-dsl-xvm/test/unit/ux/__snapshots__/component.test.js.snap +++ b/packages/hap-dsl-xvm/test/unit/ux/__snapshots__/component.test.js.snap @@ -2250,7 +2250,7 @@ exports[`Component 编译测试 ux components: ../../../lib/loaders/template-loa \\"attr\\": { \\"dataData2\\": function () {return this.attrData}, \\"src\\": \\"/packages/hap-dsl-xvm/test/case/ux/TestComponent/Image/Common/home.png\\", - \\"alt\\": \\"/packages/hap-dsl-xvm/test/case/ux/TestComponent/Image/Common/home.png\\" + \\"alt\\": \\"./Common/home.png\\" } }, { @@ -2258,7 +2258,7 @@ exports[`Component 编译测试 ux components: ../../../lib/loaders/template-loa \\"attr\\": { \\"dataData1Data2\\": \\"abc\\", \\"src\\": \\"/packages/hap-dsl-xvm/test/case/ux/TestComponent/Common/home.png\\", - \\"alt\\": \\"/packages/hap-dsl-xvm/test/case/ux/TestComponent/Common/home.png\\" + \\"alt\\": \\"../Common/home.png\\" } }, { diff --git a/packages/hap-toolkit/fixtures/com.application.demo.__preview__.debug.1.0.0.rpks b/packages/hap-toolkit/fixtures/com.application.demo.__preview__.debug.1.0.0.rpks new file mode 100644 index 00000000..21875c36 Binary files /dev/null and b/packages/hap-toolkit/fixtures/com.application.demo.__preview__.debug.1.0.0.rpks differ