如何解决VueJS 解释来自 Laravel Blade 的显示数据
我的 VueJs + Laravel 项目有问题。在我的项目中,我只将 VueJs 用于复杂的组件(我不会将 VueJs 用于简单的表单)。
我在我的数据库中插入了这个值:{{-- test --}} 只是为了测试。当我想用 Blade 显示它时,我有一个 VueJs 错误。
为什么 VueJs 将我的字符串解释为 VueJs 变量?
我的代码:
// app.js
window.app = new Vue({
el: '#app',});
// test.blade.php
// ...
<h1>{{ $test ?? '' }}</h1>
// ...
// TestController.php
// ...
public function show()
{
$test = '{{-- actions --}}';
return view('my-view.test',compact('test'));
}
// ...
这是 VueJs 错误:
[Vue warn]: Error compiling template:
invalid expression: missing ) after argument list in
_s(-- actions --)
Raw expression: {{-- actions --}}
174| <div class="row">
175| <div class="col-sm-8">
176| <h1>{{-- actions --}}</h1>
| ^^^^^^^^^^^^^^^^^
(found in <Root>)
如果您需要更多信息,请告诉我。
感谢您的帮助!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。