Laravel 模板语言 Blade 和 VueJS 数据绑定(bind)语法非常相似。
在 *.blade.php
文件中如何转义 VueJS 数据绑定(bind)语法?
示例:
<div>
<!-- Want it with VueJS -->
{{ selectedQuestionDesc }}
</div>
<div>
<!-- Want it with Laravel Blade -->
{{ $selectedQuestionDesc }}
</div>
最佳答案
在问这个问题时,我发现你可以通过在双括号 {{}}
或 {!! !!}
html 渲染括号。
答案是:
<div>
<!-- HTML rendering with VueJS -->
@{{ selectedQuestionDesc }}
<!-- Data binding with VueJS -->
@{{ selectedQuestionDesc }}
</div>
<div>
<!-- HTML with Laravel Blade -->
{!! $selectedQuestionDesc !!}
<!-- Variable binding with Laravel Blade -->
{{ $selectedQuestionDesc }}
</div>
关于laravel - 在 Laravel Blade 中转义 VueJS 数据绑定(bind)语法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37934124/