Skip to content

Commit c00a044

Browse files
committed
Fix error in template string replacement
1 parent 4fa9a19 commit c00a044

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

src/Compiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private function handleAttributeBinding(DOMElement $node)
224224
$templateStringContent = $matches['content'];
225225

226226
$templateStringContent = preg_replace(
227-
'/\$\{(.+)\}/',
227+
'/\$\{([^}]+)\}/',
228228
'{{ $1 }}',
229229
$templateStringContent
230230
);
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div class="block">
2+
<div class="block block--{{ modifier }}" style="fill: {{ color }}; height: {{ height }}">
3+
Hello World
4+
</div>
5+
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="block">
3+
<div :class="`block block--${modifier}`" :style="`fill: ${color}; height: ${height}`">
4+
Hello World
5+
</div>
6+
</div>
7+
</template>
8+
9+
<script>
10+
export default {
11+
props: {
12+
modifier: {
13+
type: String,
14+
required: true,
15+
},
16+
},
17+
};
18+
</script>

0 commit comments

Comments
 (0)