简体   繁体   English

vue.js:[Vue 警告]:编译模板时出错:+ 在 laravel 刀片文件中

[英]vue.js: [Vue warn]: Error compiling template: + in laravel blade file

I have one blade file which prints data from the database.我有一个从数据库打印数据的刀片文件。

When someone adds data like below in database then while rendering that page I am facing below issue.当有人在数据库中添加如下数据时,在呈现该页面时,我面临以下问题。

在此处输入图像描述

I have added in below text in the comment.我在评论中添加了以下文字。 [{{ auth()->user()->first_name }}]

在此处输入图像描述

My blade file code to print comment我的刀片文件代码打印评论

在此处输入图像描述

the issue is coming because in a comment there are double curly braces, can someone help me how can I prevent this?问题来了,因为在评论中有双花括号,有人可以帮助我如何防止这种情况发生吗?

To skip Vue from compiling data containing double curly braces ( {{some text}} ) for an element, you could use v-pre .要跳过 Vue 为元素编译包含双花括号( {{some text}} )的数据,您可以使用v-pre This will display raw mustache tags :这将显示原始的胡子标签:

<span v-pre>[{{ auth()->user()->first_name }}]</span>

More : v-pre更多: v-pre

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM