gpt4 book ai didi

laravel - 在 Laravel Blade 中转义 VueJS 数据绑定(bind)语法?

转载 作者:搜寻专家 更新时间:2023-10-30 22:09:04 24 4
gpt4 key购买 nike

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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com