ctf0
488
1
Vue

how to use vue with laravel partials

Posted 2 years ago by ctf0

in laravel you have a login & register partial which extends the layout.app file.

so how can we use vuejs for both forms submission, atm i tried https://laracasts.com/series/learning-vue-step-by-step/episodes/20 but it doesnt work with things like v-model / etc...

// layout.app

<component is={{ $viewComp or '' }}>
      @yield('content')
</component>


// login

@extends('layouts.app', ['viewComp'=>'login'])
@section('content')
     <!-- the login form -->
@endsection
// app.js

Vue.component('login', require('./components/Login.vue'));

const app = new Vue({
    el: '#app'
});
// login.vue

<template></template>

<script>
    export default {
        data() {
            return {
                identity: '',
                password: '',
                remember: false
            }
        },
        methods: {
            loginForm(event) {
                // ...
            }
        },
    }
</script>

but instead i get

demo.jpg

so have anyone gone through such scenario ?

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