File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Paneon \VueToTwig \Tests ;
4+
5+ class VueHtmlTest extends AbstractTestCase
6+ {
7+ public function testHtml ()
8+ {
9+ $ component = file_get_contents (__DIR__ .'/fixtures/vue-html/html.vue ' );
10+ $ expected = file_get_contents (__DIR__ .'/fixtures/vue-html/html.twig ' );
11+
12+ if (!$ component ){
13+ self ::fail ('Component not found. ' );
14+ return ;
15+ }
16+
17+ $ compiler = $ this ->createCompiler ($ component );
18+
19+ $ actual = $ compiler ->convert ();
20+
21+ $ this ->assertEqualHtml ($ expected , $ actual );
22+ }
23+ }
Original file line number Diff line number Diff line change 1+ {% set rawHtml = ' <strong>text</strong>' %}
2+ <template >
3+ <div >
4+ <span >
5+ {{ rawHtml | raw }}
6+ </span >
7+ </div >
8+ </template >
Original file line number Diff line number Diff line change 1+ <template >
2+ <div >
3+ <span v-html =" rawHtml" />
4+ </div >
5+ </template >
6+
7+ <twig >
8+ {% set rawHtml = '<strong>text</strong>' %}
9+ </twig >
10+
11+ <script >
12+ export default {
13+ computed: {
14+ rawHtml (){
15+ return ' <strong>text</strong>' ;
16+ },
17+ }
18+ }
19+ </script >
You can’t perform that action at this time.
0 commit comments