Skip to content

Commit 34a4238

Browse files
authored
Merge pull request #51 from tronsha/bugfix/#47
Fix #47
2 parents 38059a6 + 856c589 commit 34a4238

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ private function handleAttributeBinding(DOMElement $node)
407407
}
408408

409409
$node->setAttribute(
410-
$name,
410+
$name === 'src' ? Replacements::getSanitizedConstant('SRC_ATTRIBUTE_NAME') : $name,
411411
$this->implodeAttributeValue($name, $dynamicValues, $staticValues)
412412
);
413413
}

src/Models/Replacements.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ abstract class Replacements extends BasicEnum
1212
public const SMALLER = '<';
1313
public const AMPERSAND = '&';
1414
public const PIPE = '|';
15+
public const SRC_ATTRIBUTE_NAME = 'src';
1516

1617
/**
1718
* Removes all instances of replacements from target
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="{{class|default('')}}">
2+
<img src="{{isBool ? varA : varB}}">
3+
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div>
3+
<img :src="isBool ? varA : varB">
4+
</div>
5+
</template>

0 commit comments

Comments
 (0)