ctf0 / Laravel-Media-Manager

A "Vuejs & Laravel" Media Manager With Tons of Features
MIT License
832 stars 181 forks source link

Is it possible to use the package with vue SPA #130

Closed BechirAhmed closed 4 years ago

BechirAhmed commented 4 years ago

Any one found a solution for integration to Vue SPA?

ctf0 commented 4 years ago

can u make a repo with ur setup for me to try with ?

also can u tell me what have u tried and didnt work ?

BechirAhmed commented 4 years ago

for now i didn't tried so much, because i didn't knew how to import it to vue component, I already tried it with blade and worked great, @include('MediaManager::_manager'). But i don't know how to import it to vue component and what to change and not, if you can guide me a little

ctf0 commented 4 years ago

// assets mix.copyDirectory('resources/assets/vendor/MediaManager/dist', 'public/assets/vendor/MediaManager')

// js window.Vue = require('vue')

require('../assets/vendor/MediaManager/js/manager')

new Vue({ el: '#app' })


- lastly the routes

ctf0\MediaManager\MediaRoutes::routes();



i believe thats all, however i havent used the package in something other than laravel, so without extra info of what exactly u have tried and what not sadly i cant help
BechirAhmed commented 4 years ago

thans for your answer, I use Laravel for backend, and to be exactly my question is if there something (component) like <media-manager></media-manage> like what the package use when calling @include('MediaManager::_manager') in blade file, something like that to import in vue SPA? or if i copied the same file <media-manager> and edit it (like change laravel stuff - config, trans ...),? what's ur advice

ctf0 commented 4 years ago

the manager is basically a one big component https://github.com/ctf0/Laravel-Media-Manager/blob/master/src/resources/views/_manager.blade.php

the only diff is that it use inline-template because it depends on lots of laravel stuff, which have some limitations outside the usual component based arch of vue "u cant just include the component into another and get done with it".

however i believe u can get around that by declaring the component in ur main view/route so its always available & use some variables to disable/enable it like we do in the modal example https://github.com/ctf0/Laravel-Media-Manager/wiki/Use-The-Manager-From-A-Modal

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.