Answer the question
In order to leave comments, you need to log in
How to implement blade code output inside blade so that vue does not throw errors on variables (or how to escape curly braces in Vue)?
{!! !!} displays code like {!! $var !!}, but if inside $var there is a string ' {{ $var2 }}' ( $var = '{{ $var2 }}'
), the burden of displaying the variable inside {{ .. }} is taken by vue, and eventually gives an error
[Vue warn]: Property or method "$var" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
(found in <Root>)
<div class="body"><span v-html="{!! $var !!}"></span></div>
const app = new Vue({
delimiters: ['${', '}'],
el: '#app'
});
. Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question