luddinus
957
5
Vue

Vuejs instance in master.blade and other instance in login page?

Posted 2 years ago by luddinus

Hi,

I'm relative new to vuejs world.

I have a master.blade template, where I load master.js script.

<html>
   ...
   <body>
      <div id="master">
         <h1>@{{ message }}</h1>

         @yield('content')
      </div>
      
      <script src="/js/master.js'></script>
      @stack('scripts')
   </body>
</html>

master.js (nothing relevant from now)

var app = new Vue({
   el: '#master',

   data: {
      message: 'Hello World!',
   }
});

Now I have a login page that extends the master page (which already "loads" a Vue app), and I want to test some button

login.blade.php

@extends('master')

@section('content')
<button @click="testClick">Click me</button>
@stop

@push('scripts')
// HERE IS MY QUESTION
// get the master.blade.php app and "add" the testClick function??
@endpush

Where do I implement the "testClick" function?

Thx

Please sign in or create an account to participate in this conversation.