Writing JavaScript: Writing Vue Components

Vue.component(
    'example-component',
    require('./components/ExampleComponent.vue')
);
@extends('layouts.app')

@section('content')
    <example-component></example-component>
@endsection
  • Located in the resources/js/components directory.
  • The ExampleComponent.vue file is an example of a single file Vue component which defines its JavaScript and HTML template in the same file.
  • To use the component in your application, you may drop it into one of your HTML templates.

Writing JavaScript: Writing Vue Components — Structure map

Clickable & Draggable!

Writing JavaScript: Writing Vue Components — Related pages: