@extends('layouts.app')
@section('body')
<div class="general_wrapper" id="profile">
@component('components.nav.main')
@slot('menu')
<div class="nav_menu">
<ul>
<li :class="{'active': tab==0}" @click="tabSelect(0)">
item0
</li>
<li :class="{'active': tab==1}" @click="tabSelect(1)">
item1
</li>
</ul>
</div>
@endslot
@endcomponent
</div>
@endsection
@section('script')
<script>
const profile = new Vue({
el: '#app',
data: {
tab: 0
},
methods: {
tabSelect(id) {
profile.tab = id;
}
}
});
</script>
@endsection
I need this bunch of code inside my project. I don't know what wrong with it. I got this error:
Property or method "tab" is not defined on the instance but referenced during render.
I removed 'const app = new Vue({ el: '#app'});' from app.js it works, but I have another Vue component in my project, and this made another one unknown...