简体   繁体   中英

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 . This will display raw mustache tags :

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

More : v-pre

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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