Answer the question
In order to leave comments, you need to log in
Laravel blade + Vue logic conflict?
There is a page, let's say a user, each user has his own custom background. Therefore, for each you need to prescribe your own styles, I did it earlier like this:
@extends('layouts.app')
@section('content')
<style>
body {
background-image: url("{{ $user->background_url }}");
}
</style>
<div class="container user_profile">
<div class="row justify-content-center">
<div class="col-md-12">
<div class="row">
...
@endsection('content')
@push('scripts')
...
@endpush
...
- Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <style>, as they will not be parsed.
Answer the question
In order to leave comments, you need to log in
You get:
<div id="vue-app">
<!--Blade-->
<style>.some{}</style>
</div>
@extends('layouts.body')
@section('body_content')
<div id="app">
@include('menus.top')
@yield('content')
@include('menus.bottom')
</div><!-- #app -->
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
@yield('page_script')
@endsection
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question