Answer the question
In order to leave comments, you need to log in
How to make VSC properly accept Blade embedded in Vue like {!! $someVar !!} - and didn't paint it red?
It so happened that now I have to create a mutant and inject PHP variables in the Blade template right in Vue, like:
<script>
new Vue({
el: '#app',
data: function() {
return {
var: {!! $someVar !!}
}
},
methods: {},
mounted() {},
})
</script>
var: {!! $someVar !!}
and everything behind it, and swears:Non-null assertions can only be used in TypeScript files.
= $someVar Answer the question
In order to leave comments, you need to log in
Not much better, but at least you can remove scripts from html
<script>const someVar = {!! $someVar !!};</script>
new Vue({
el: '#app',
data: function() {
return {
var: window.someVar
}
},
methods: {},
mounted() {},
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question