1.0.0 • Published 5 years ago

lavuetils v1.0.0

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

LaVuetils

Object Oriented Vue Instance Manipulation, with Laravel in mind.

SETUP

  1. Let's start from a fresh Laravel project and work directly from a project that has scaffolded the Vue UI with authentication:
    laravel new Project

    cd Project

    composer require laravel/ui --dev

    php artisan ui vue --auth

    npm install lavuetils

    npm run watch

If you already have a project, then simply run:

    npm install lavuetils
  1. In the app.js file, replace the default Vue Instance with the following:
    FROM:

// resources/js/app.js

    const app = new Vue({
        el: '#app',
    });
    TO:

// resources/js/app.js

    import lavuetils from 'lavuetils'

    window.lavuetils = lavuetils
  1. Remove "defer" from the header script tag of you app layout blade.

    From:

    <script src="{{ asset('js/app.js') }}" defer></script>

    To:

    <script src="{{ asset('js/app.js') }}"></script>

  2. Instantiate the Vue instance with a separate script tag at the bottom of the body.

    <script> lavuetils.instantiate() </script>