ctf0
12
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.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.