How do I add a custom Vue component to the admin?

This repo (https://github.com/aerocargo/admin-example-vue

You need to add the assetLinksfunction to your modules service provider so that your modules assets are publicly linkable. An example module service provider can be found here in the repo (https://github.com/aerocargo/admin-example-vue/blob/master/src/ServiceProvider.php

You also need to make your component .vuefile(s) and your main .jsfile that will register all of the components. An example javascript structure can be found here in the repo (https://github.com/aerocargo/admin-example-vue/tree/master/resources/js

Once you’ve got your files setup and have built the javascript files (using npm - npm run devor npm run production), you need to ensure that your module's components javascript file is loaded and the components are registered in the Blade view where you want to use the component(s). To do this you need to include the javascript file from your module and then register the components through the window.AeroAdmin.vue.usemethod.

@push('scripts')
   <script src="{{ asset(mix('components.js', 'modules/aerocargo/admin-example-vue')) }}"></script>
   <script>
       window.AeroAdmin.vue.use(window.exampleAdminComponents);
   </script>
@endpush

Once you have completed this you’ll be able to use your custom Vue component(s) anywhere in the Blade file where you have registered them.


Revision #1
Created 2026-09-02 13:27:35 UTC by Michael Price
Updated 2026-09-02 13:27:35 UTC by Michael Price