D
D
danilr2019-11-03 20:51:40
Vue.js
danilr, 2019-11-03 20:51:40

Why laravel(blade) template doesn't see Vue property?

Here is the included script "developer.js"

window.Vue = require('vue');

Vue.component('example-component', require('./components/ExampleComponent.vue').default);

const apps = new Vue({
  el: '#app',
  data:{
    mes: 'guygu'
  },
  mounted(){
    console.log(this.mes);
  }
})

Here is the developer.blade.php template
@extends('templates.app')

@section('styles')
<link href="{{ asset('css/developer.css') }}" rel="stylesheet"></link>
@endsection

@section('layout')
<div>
    @{{mess}}  // это свойство пытаюсь вывести на страницу
    <example-component></example-component>
</div>

@endsection

@section('footer-scripts')
<script src="{{ asset('js/developer.js') }}"></script>
@endsection

Mistake
5dbf13aa84156698619707.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Suha, 2019-11-03
@andreysuha

data() {
 return {
     mes: "dfgguu"
}
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question